3A. It is known that the roots of the equation $x^{2}+p x+q=0$ are integers. If $p+q=198$, determine the roots of the equation and the numbers $p$ and $q$.
Solution. If $x_{1}$ and $x_{2}$ are roots of the equation $x^{2}+p x+q=0$, then according to Vieta's formulas we have

$$
\left\{\begin{array}{l}
x_{1}+x_{2}=-p \\
x_{1} x_{2}=q
\end{array}\right.
$$

From the above equations and the given equation (the dependence between $p$ and $q$), we get

$$
198=p+q=-\left(x_{1}+x_{2}\right)+x_{1} x_{2}=\left(x_{1}-1\right)\left(x_{2}-1\right)-1
$$

According to this, $\left(x_{1}-1\right)\left(x_{2}-1\right)=199$. Since $x_{1}, x_{2}$ are integers and $x_{1}-1, x_{2}-1$ are integers, and 199 is a prime number, we get

$$
\left\{\begin{array}{l}
x_{1}-1=1 \\
x_{2}-1=199
\end{array} \text { or } \quad \left\{\begin{array}{l}
x_{1}-1=-1 \\
x_{2}-1=-199
\end{array}\right.\right.
$$

The solutions $\left(x_{1}, x_{2}\right)$ of the above systems are $(2,200)$ and $(0,198)$. For the solution $(2,200)$, according to Vieta's formulas, we get $p=-2-200=-202, q=2 \cdot 200=400$, and for the solution $(0,198)$ we have $p=-198, q=0$.