If bodies B and C have the same mass but body C is twice the density of B, than body C has smaller radius then B.
So distance between A and the centers of B/C as stated is the same, but the distance from A to the surface of B is less then to the surface of C.
As gravity of the body fades with...