Let the point be P, and the masses be located at P1 and P2.
The centre of mass is such that the moments of masses m1 and m2 exert an equal moment at the point P, and the distance P1P2=d namely,
m1(mPP1)=m2(mPP2) The distance of the centre of mass from m1 is therefore d1=d*m2/(m1+m2) Similarly, the distance of the centre of mass from m2 is d2=d*m1/(m1+m2)