Find the maximum temperature attained by the gas during the change
The ideal gas law $pV = nRT$ allows us to relate one of $p$, $V$, and $T$ to the two other variables, and is the main equation to work with here. 

Rephrasing the original question to make it more suggestive, we are interested in maximizing $T(p,V)$ subject to the constraint $p(V)$, a linear function in $V$ readily found from the conditions specified in the problem. Substituting $p(V)$ for $p$ to get $T = T(p(V),V) = T(V)$, we have reduced the problem to one amenable to simple calculus techniques, and the answer follows from taking a derivative.



Remark. In general, extremization problems are not so easy, and we will need to use the more powerful tool of Lagrange multipliers.