Two masses m1 & m2 are kept in a vertical line. m1 = 10kg, m2 = 30kg
The first block is raised through a height of 7cm.
The centre of mass is raised by 1cm.
$\therefore1=\frac{\text{m}_1\text{y}_1+\text{m}_2\text{y}_2}{\text{m}_1+\text{m}_2}=\frac{10\times7+\text{30y}_2}{40}$
$\Rightarrow1=\frac{70+30\text{y}_2}{40}$
$\Rightarrow70+30\text{y}_2=40$
$\Rightarrow30\text{y}_2=-30$
$\Rightarrow\text{y}_2=-1$
The 30kg body should be displaced 1cm downward inorder to raise the centre of mass through 1cm.