Answer
a) $5.2\;\rm m/s^2$
b) $\approx 1000\;\rm kg$
Work Step by Step
a)
There are only two forces exerted on the rocket vertically,
the thrust force and the gravitational force.
This means that the net force exerted on the rocket is given by
$$\sum F=F_{\rm Thrust}-mg=ma_y$$
Solving for $a_y$;
$$a_y=\dfrac{F_{\rm Thrust}-mg}{m}=\dfrac{(3\times10^5)-(20\;000\cdot 9.8)}{20\;000}$$
$$a_y=\color{red}{\bf 5.2}\;\rm m/s^2$$
b)
We know that thrust force is constant but the mass of the rocket decreases since it loses fuel.
Thus, the final mass of the rocket at 5000 m above the ground is given by
$$F_{\rm Thrust}-m_fg=m_fa_{y2}$$
$$F_{\rm Thrust}=m_fa_{y2}+m_fg=m_f(a_{y2}+g)$$
Solving for $m$;
$$m_f=\dfrac{F_{\rm Thrust} }{ a_{y2}+g}=\dfrac{3\times10^5}{6+9.8}=1.9\times10^4\bf\;\rm kg$$
Thus, the mass of the fuel is given by
$$m_{fuel}=m_i-m_f=20\;000-1.9\times10^4$$
$$m_{fuel}\approx \color{red}{\bf 1000}\;\rm kg$$