According to Newton law of Gravitation the force of attraction between two bodies is give by F = G m1m2/r^2
where m1 and m2 are the masses and r is the distance between them
therefore, 2 = Gm1m2/5^2 = Gm1m2/25 .............1)
Now if, F = 8 units, then
8 = Gm1m2/r^2 .......................2)
Dividing 2) by 1) we get,
8/2 = 25/r^2
4 = 25/r^2
r^2 = 25/4
r = 5/2 = 2.5 cm Ans.