12・19 Find all natural numbers $p$ and $q$ such that the roots of the equation $x^{2}-p q x+p+q=0$ are integers.
(17th All-Russian Mathematical Olympiad, 1991)
[Solution] Let $x_{1}, x_{2}$ be the two integer roots of the given equation.
By Vieta's formulas, we have
$$
\begin{array}{l}
x_{1}+x_{2}=p q, \\
x_{1} x_{2}=p+q .
\end{array}
$$

Since $p$ and $q$ are natural numbers, the integers $x_{1}$ and $x_{2}$ are also natural numbers. From the above two equations, we get
$$
x_{1} x_{2}-x_{1}-x_{2}=p+q-p q,
$$

which leads to
$$
\left(x_{1}-1\right)\left(x_{2}-1\right)+(p-1)(q-1)=2 .
$$
Equation (1) holds in only three cases:

First case: The first term on the left side of (1) is 0, and the second term is 2, in which case we have
$$
\left\{\begin{array} { l } 
{ p - 1 = 1 , } \\
{ q - 1 = 2 , }
\end{array} \text { or } \left\{\begin{array}{l}
p-1=2, \\
q-1=1 .
\end{array}\right.\right.
$$

This gives us
$$
(p, q)=(2,3) \text { or }(3,2) \text {. }
$$

The corresponding equation is
$$
x^{2}-6 x+5=0,
$$

which has integer roots
$$
x_{1}=5, x_{2}=1 .
$$

Second case: Both terms on the left side of (1) are 1, in which case we have
$$
\left\{\begin{array}{l}
p-1=1, \\
q-1=1 .
\end{array}\right.
$$

This gives us
$$
(p, q)=(2,2) \text {. }
$$

The corresponding equation is
$$
x^{2}-4 x+4=0 \text {. }
$$

This equation has (double) integer roots $x_{1}=x_{2}=2$.
Third case: The first term on the left side of (1) is 2, and the second term is 0, in which case we have
$$
p-1=0 \text { or } q-1=0 \text {. }
$$

This implies $x_{1}=3, x_{2}=2$. Thus,
$$
x_{1}+x_{2}=5, \quad x_{1} x_{2}=6 .
$$

Therefore, when $p=1$, $q=5$, and when $q=1$, $p=5$.
This gives us
$$
(p, q)=(1,5) \text { or }(5,1) \text {. }
$$

The corresponding equation is
$$
x^{2}-5 x+6=0 \text {. }
$$

In summary, the natural numbers $p, q$ have five pairs:
$$
\left\{\begin{array} { l } 
{ p = 2 , } \\
{ q = 3 , }
\end{array} \left\{\begin{array} { l } 
{ p = 3 , } \\
{ q = 2 , }
\end{array} \left\{\begin{array} { l } 
{ p = 2 , } \\
{ q = 2 , }
\end{array} \left\{\begin{array} { l } 
{ p = 1 , } \\
{ q = 5 , }
\end{array} \left\{\begin{array}{l}
p=5, \\
q=1 .
\end{array}\right.\right.\right.\right.\right.
$$