In the problem, the acceleration due to gravitational attraction on moon has not been given. This surely cannot be taken as zero.
When the block hits the bottom of the cliff its velocity has a horizontal component and a vertical component. The vertical component is dependent only on the acceleration due to gravity and will not be considered in my answer. I only provide the horizontal component of the velocity.
The mass of the cannonball is 10 kg and that of the cannon is 40 kg. Initially, the cannon with the cannonball move at 3 m/s. On firing the cannonball, the cannon recoils at 2 m/s. As the total momentum is conserved, we have 3*(50) = 10*x - 2*40.
x = (3*50 + 2*40)/10 = 15+8 = 22 m/s
The cannon strikes the block with a weight of 32N and is embedded in it. Let's take acceleration due to gravity on the moon as Mg. So the mass of the block is 32/Mg.
When the cannon strikes it, both start to move at a velocity V.
[(32/Mg) + 10]*V = 10*22
=> V = 220 / [(32/Mg) + 10]
The horizontal component of the velocity of the block when it strikes the ground is 220 / [(32/Mg) + 10].
The vertical component can be calculated using Mg.