This is a thermodynamics problem, not a simple physics problem.