Let the velocity of A is u1 and the final velocity when reaching at B is v1.
The final speed is given as,
12mv12−12mu12=mgh
v1=√2gh−u12 (1)
When the block B reached at the upper man’s head, the velocity of B is just zero.
It can be written as,
122m(0)2−122mvB2=mgh
vB=√2gh
Let after the collision the velocity of A is v and before the collision is v1.
mv1+2m×0=m×v+2m√2gh
v1−v=2√2gh
12m(v1)2+122m(0)2=12m(v)2+12×2m×(√2gh)2
v12−v2=2×√2gh×√2gh (2)
From equation (1) and (2), we get
v1+v=√2gh (3)
From equations (1) and (3), we get
2v1=3√2gh
v1=1.5√2gh
u=2.5√2gh
Thus, the velocity of block A is 2.5√2gh.