31. Let $x$ and $y$ be positive integers such that $27 x+35 y \leq 945$. Find the largest possible value of $x y$.
31. Answer: 234
Since $27 x+35 y \leq 945$, we have $y \leq \frac{945-27 x}{35}$. It follows that
$$
x y \leq \frac{945 x-27 x^{2}}{35}=\frac{27}{35}\left(35 x-x^{2}\right)=\frac{27}{35}\left(\left(\frac{35}{2}\right)^{2}-\left(x-\frac{35}{2}\right)^{2}\right) .
$$

Therefore, if $\left|x-\frac{35}{2}\right| \geq \frac{5}{2}$, that is, if $x \geq 20$ or $x \leq 15$, then
$$
x y \leq \frac{27}{35}\left(\left(\frac{35}{2}\right)^{2}-\left(\frac{5}{2}\right)^{2}\right)<231.4 .
$$

If $x=16$, then $y \leq \frac{945-27(16)}{35} \leq 14.7$. Thus $y \leq 14$, and $x y \leq 224$.
Similarly, if $x=17$, then $y \leq 13$, and $x y \leq 221$.
If $x=18$, then $y \leq 13$, and $x y \leq 234$.
If $x=19$, then $y \leq 12$, and $x y \leq 228$.
In conclusion, the maximum value of $x y$ is 234 , which is attained at $x=18$ and $y=$ 13.