for mass m
mgl=1/2m v1^2
find initial velocity v1
similarly
2mgl=1/2mv2^2
v1 and v2 will be the velocities of m and 2m
use momentum conservation and the
e= relative velocities after collision/rel velocities before collision
u will get two equations and two variable
solve it to get the vel after collision
for the seccond part use energy conservation
to find the heights