The use of second order potentials in the theory of scattering of charged particles by atoms. VI. Elastic scattering of electrons by hydrogen and helium atoms