2018 MathCounts: Let $D(k)$ be the number of diagonals for a polygon with $k$ sides. If $D(m) + D(n) = 125$, what is the value of $m+n$? The question was asked in the 2018 Raytheon MATHCOUNTS National Competition. It appears in the video around the 35:34 mark:
https://www.youtube.com/watch?v=dSnOLW_W6og&t=2134

Let $D(k)$ be the number of diagonals for a polygon with $k$ sides. If
  $D(m) + D(n) = 125$, what is the value of $m+n$?

The formula for the number of diagonals is well-known and easily derived as $k(k-3)/2$.
I then computed several values, and found a suitable pair of numbers to solve the problem.
But is there any easier way to solve this equation:
$$\frac{n(n-3)}{2} + \frac{m(m-3)}{2} = 125$$
$$n,m \in {3, 4, ...}$$
The students were supposed to solve this in minutes without a calculator.
My guess is there is not a simpler way--in MathCounts the students may have just memorized many values.

Let $m=x-n$. Then,
$$\frac{n(n-3)}{2}+\frac{m(m-3)}{2}=125$$
is equivalent to
$$x^2-(2n+3)x+2n^2- 250 = 0$$
which implies
$$x=\frac{2n+3\pm\sqrt{1018-(2n-3)^2}}{2}$$
So, there has to be an integer $k$ such that $$1018=(2n-3)^2+k^2$$
Here, both $2n-3$ and $k$ are odd. 
Since the rightmost digit of $(\text{odd})^2$ is either $1,9$ or $5$, both the rightmost digit of $(2n-3)^2$ and that of $k^2$ are $9$.
So, we only need to consider
$$3^2=9, 7^2=49, 13^2=169, 17^2=289, 23^2=529, 27^2=729$$
So, we see that 
$$27^2+17^2=1018$$
is the only possible sum.
So, $2n-3=27$ implies $n=15$, and $2n-3=17$ implies $n=10$.
Therefore, $$\color{red}{m+n=x=25}$$
