HMMT-Feb 2017 guts, Problem 21

Let $P$ and $A$ denote the perimeter and area respectively of a right triangle with relatively prime integer side-lengths. Find the largest possible integral value of $\frac{P^{2}}{A}$

Solution: Assume WLOG that the side lengths of the triangle are pairwise coprime. Then they can be written as $m^{2}-n^{2}, 2 m n, m^{2}+n^{2}$ for some coprime integers $m$ and $n$ where $m>n$ and $m n$ is even. Then we obtain \[ \frac{P^{2}}{A}=\frac{4 m(m+n)}{n(m-n)} \] But $n, m-n, m, m+n$ are all pairwise coprime so for this to be an integer we need $n(m-n) \mid 4$ and by checking each case we find that $(m, n)=(5,4)$ yields the maximum ratio of 45 . $\fbox{45}$.

Answer: 45