Resultant velocity of the rocket after 5 sec
\(v = 2g \times 5 = 10g\;m/s\)
Height achieved after \(5\, sec\), \({h_1} = \frac{1}{2} \times 2g \times 25 = 245m\)
On switching off the engine it goes up to height \({h_2}\) where its velocity becomes zero.
\(0 = {(10g)^2} - 2g{h_2} \Rightarrow {h_2} = 490m\)
\(\therefore \) Total height of rocket \( = 245 + 490 = 735\;m\)