Scattering theory and large time asymptotics of solutions to the Hartree type equations with a long range potential