The easiest way to do this is to use gravitational potential.
First the man does work on the rock hauling it from 300m to 500m.
This work is given by
\(W_1=m g \Delta h = 20 \times 9.8 \times (500-300) = 39200 J\)
Then Earth's gravity does work on the stone during the fall from 500m to 0m. Again this work is the difference in gravitational potential
\(W_2 = 20 \times 9.8 \times 500 = 98000J\)
\(\mbox{The total work is } \\ W_T=W_1+W_2 = 39200+98000 =137200J\)
.