Dear Student,
Please find below the solution to your problem.
Given,
the 2 masses are m1and m2
let x and y be the distance of m1and m2from the centre of mass respectively...
now, m1x = m2y
the mass m1 is moved by a distance d,
let the mass m2 be moved by a distance D
therefore, m1( x - d) = m2 (y -D )
= m1x - m1d = m2y - m2D
by eqn (i) m1x = m2y
= -m1d = -m2D
= D = (m1/m2) d
Thanks and Regards