A vertical heat-insulated cylinder is divided into two parts by a movable piston of mass m. Initially the piston is held at rest. The top part is evacuated and the bottom part is filled with 1 mol of diatomic ideal gas at temperature T. After the piston is released and the system comes to equilibrium, the volume occupied by the gas is halved. Find the final temperature of the gas.