To go the maximum distance the shell must be fired at an angle of 45 degrees, which means its initial horizontal and vertical velocities are equal; call it v_1. From y=y_0 +v_1 t - (1/2)gt^2 you can set up an equation for the time the shell is aloft. Then use that expression for time in the equation for horizontal motion: x = x_0+v_1 t = 41Km and solve for v_1. Don;t forget that the initial velocity is the vector sum of the initial vertical and horizontal velocity components.
Once you have the answer to (a), (b) should be straight forward.