Answer
$1.687\times 10^6\;\rm J$
Work Step by Step
First of all, we need to find the work done by the engine to lift the crane 30 m above.
$$W_{out}=\Delta U_g=mgy_f-mgy_i=mgy_f-0$$
Hence,
$$W_{out} =mgy_f\tag 1$$
We are told that the efficiency of this engine is 40% as efficient as a Carnot engine.
$$\eta=0.4\eta_c$$
where $\eta_c=1-\dfrac{T_C}{T_H}$, and $\eta=W_{out}/Q_H$
$$\dfrac{W_{out}}{Q_H}=0.4\left[1-\dfrac{T_C}{T_H}\right] $$
Hence,
$$Q_H=\dfrac{W_{out}}{0.4\left[1-\dfrac{T_C}{T_H}\right]}$$
Plugging from (1);
$$Q_H=\dfrac{mgy_f}{0.4\left[1-\dfrac{T_C}{T_H}\right]}$$
Plugging the known;
$$Q_H=\dfrac{(2000)(9.8)(30)}{0.4\left[1-\dfrac{(20+273)}{(2000+273)}\right]}$$
$$Q_H=\color{red}{\bf 1.687\times 10^6}\;\rm J$$