The shell's vertical position
at time
is given by

where
is the acceleration due to gravity. The shell hits the water when
, so the time it takes for that to happen is

For the shell to reach a height of
, it must travel for a time
such that

The shell's horizontal position
is given by

so that after 2.02 seconds, the warship should be at a distance

away from the pirate ship in order to hit it at the desired height.