Example 9 (IMO-19 Problem) Let $a, b$ be positive integers. When $a^{2}+b^{2}$ is divided by $a+b$, the quotient is $q$ and the remainder is $r$. Find all pairs of numbers $(a, b)$ such that $q^{2}+r=1977$.

---

The translation maintains the original text's line breaks and format.
Solve: Since $a^{2}+b^{2}=q(a+b)+r$, where $0 \leqslant r < q$, and if $r > 0$ it leads to a contradiction, so $q \leqslant 44$, and $\frac{a^{2}+b^{2}}{a+b} < 128$. Without loss of generality, assume $a \geqslant b$, then $a \geqslant \frac{1}{2}(a+b)$.
When $a \leqslant \frac{2}{3}(a+b)$, $b \geqslant \frac{1}{3}(a+b)$,
$\frac{a^{2}+b^{2}}{a+b} \geqslant \frac{\left[\frac{1}{2}(a+b)\right]^{2}+\left[\frac{1}{3}(a+b)\right]^{2}}{a+b}=\frac{13}{36}(a+b)$.
Since $(a+b) > 128$, so
$\frac{a^{2}+b^{2}}{a+b} > 46$, which contradicts $\frac{a^{2}+b^{2}}{a+b} < 46$. Therefore, $a > \frac{2}{3}(a+b)$,
$\frac{a^{2}+b^{2}}{a+b} > \frac{\left[\frac{2}{3}(a+b)\right]^{2}}{a+b} = \frac{4}{9}(a+b) > 56$, which contradicts $\frac{a^{2}+b^{2}}{a+b} < 56$. Therefore, $\frac{a^{2}+b^{2}}{a+b} < 43$.
But since $q \leqslant 44$, hence $q = 44$ and $r = 41$, so we have
$a^{2}+b^{2}=44(a+b)+41$, which simplifies to
$(a-22)^{2}+(b-22)^{2}=1009$.
Solving this, we get $\left\{\begin{array}{l}a_{1}=50, \\ b_{1}=37 ;\end{array} \quad\left\{\begin{array}{l}a_{2}=50, \\ b_{2}=7 ;\end{array}\right.\right.$
15
$$
\left\{\begin{array}{l}
a_{3}=37, \\
b_{3}=50 ;
\end{array} \quad \left\{\begin{array}{l}
a_{4}=7, \\
b_{4}=50 .
\end{array}\right.\right.
$$

Thus, the pairs $(a, b)$ are:
$(50,37),(50,7),(37,50),(7,50)$.