When pressure, volume, and temperature all change, the ideal-gas ratio pV over T stays constant.
Compute the first gas ratio
The first state uses pressure 2, volume 6, and temperature 300 kelvin.
TipiVi=300 K2 Pa⋅6 m3
Compute the second gas ratio
The second state uses pressure 4, volume 4, and temperature 400 kelvin.
TfpfVf=400 K4 Pa⋅4 m3
The combined ratio matches
Both states give one twenty fifth joule per kelvin.
TpV=251 J/K