The question is based on first law of Thermodynamics,
When is supplied to a system, it increases it internal energy then it does some work,i.e it gets expanded
As given in the question that work is done on the system, hence the the heat introduced into the system from surrounding will only increase the internal energy
let H is the energy supplied to the sytem
ΔE be the change in internal energy
W is the work done on the system
Therefore H = ΔE + W (W = PΔV)