18.2.13 ** Let $a, b, c, d, m, n$ be positive integers, $a^{2}+b^{2}+c^{2}+d^{2}=1989, a+b+$ $c+d=m^{2}$, and the largest of $a, b, c, d$ is $n^{2}$. Determine (and prove) the values of $m, n$.
From the Cauchy-Schwarz inequality, we have \(a + b + c + d \leqslant 2 \sqrt{1989} \sqrt{a^2 + b^2 + c^2 + d^2}\). This leads to \(m^2 = 49\) or 81. Without loss of generality, let \(a \leqslant b \leqslant c \leqslant d = n^2\). From \(4d^2 \geqslant a^2 + b^2 + c^2 + d^2 = 1989\), we know \(d \geqslant 23\).

If \(m^2 = 49\), then \((49 - d)^2 = (a + b + c)^2 > a^2 + b^2 + c^2 = 1989 - d^2\), which implies \(d^2 - 49d + 206 > 0\). Thus, \(d > 44\) or \(d \leqslant 4\). Therefore, \(d \geqslant 45\). However, \(45^2 > 1989 > d^2\), leading to a contradiction. Hence, \(m^2 \neq 49\). Therefore, \(m^2 = 81\), \(m = 9\), and \(d = n^2 \in \{25, 36\}\).

If \(d = n^2 = 25\), let \(a = 25 - p\), \(b = 25 - q\), \(c = 25 - r\), where \(p, q, r \geqslant 0\). Then \(p + q + r = 19\) and \(p^2 + q^2 + r^2 = 439\), which contradicts \((p + q + r)^2 > p^2 + q^2 + r^2\). Therefore, \(n^2 = 36\), \(n = 6\). When \(a = 12\), \(b = 15\), \(c = 18\), and \(d = 36\), we achieve \(m = 9\) and \(n = 6\).