How much work must a heat pump with a COP of 2.50 do in order to extract 1.00 MJ of thermal energy from the outdoors (the cold reservoir)?
The first formula that came into my mind after reading this question is the
$$COP=\frac{\lvert Q(\text{cool})\rvert}{\lvert W\rvert}$$
However, when I used the equation above, the answer that I got was 0.4 MJ instead of the answer given which is 0.67 MJ.
And then I tried various other ways to try and get the 0.67 MJ and only when I used this equation that I finally get the answer 0.67 MJ.
$$COP=\frac{\lvert W+Q(\text{cool})\rvert}{\lvert W\rvert}$$
What I don't understand is that why do we need to add $W$ with $Q$? Or is it not the correct way after all?
Would somebody explain this to me, please?