N19 (19-5, German Democratic Republic) 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 $(a, b)$ such that $q^{2}+r=1977$.

When $a^{2}+b^{2}$ is divided by $a+b$, the quotient is $q$, and the remainder is $r$, find all pairs $(a, b)$ such that $q^{2}+r=1977$.