Answer:
During its trajectory the cannon ball will have kinetic and potential energy
E = KE + PE
The maximum value of PE will occur when the cannon ball was fired straight up - for other trajectories PE will be less because of translational KE
So E = M g h = 1/2 M v^2 for maximum height
h = v^2 / (2 * g) = 400 / (2 * 9.8) = 20.4 m