Step-by-step explanation:
Recession velocity of a galaxy is related to the distance at which the galaxy is located. This relationship is given by the hubble constant, as follows:

Hubble constant is aproximate
and 1 megaparsec (Mpc) is 3.26*10^6 light years. Rewriting for D:

For galaxy A:

For galaxy B:
