A solvable model of a one-dimensional quantum gas with pair interaction