Imagine that the water vapor in the container expands when heated and lifts the piston to do work.
therefore
External work of the system
A=-P(V2-V 1) P is atmospheric pressure, and V2 and V 1 are independent volumes.
The change of internal energy is-a.