The centre of mass of a system of two particles of masses m1 and m2 is at a distance d1 from m1 and at a distance d2 from mass m2 such that
d1d2 = m2m1
d1d2 = m1m2
d1d2 = m1m1+m2
d1d2 = m2m1+m2
Refer figure,
The distances of centre of mass CM from masses m1 and m2 are
d1 = m2dm1+m2 and d2 = m1dm1+m2 ∴ d1d2 = m2m1