7.1. The numbers $p$ and $q$ are chosen such that the parabola $y=p x-x^{2}$ intersects the hyperbola $x y=q$ at three distinct points $A, B$, and $C$, and the sum of the squares of the sides of triangle $A B C$ is 324, while the centroid of the triangle is 2 units away from the origin. Find the product $p q$.
Answer: 42.

Solution. The system $y=p x-x^{2}, x y=q$ reduces to the cubic equation $x^{3}-p x^{2}+q=0$, which has, according to the problem, three distinct roots $x_{1}, x_{2}, x_{3}$, since the abscissas of any two different points on the curve $y=p x-x^{2}$ are distinct. By Vieta's theorem,

$$
x_{1}+x_{2}+x_{3}=p, \quad x_{1} x_{2}+x_{1} x_{3}+x_{2} x_{3}=0, \quad x_{1} x_{2} x_{3}=-q .
$$

Let $A\left(x_{1}, y_{1}\right), B\left(x_{2}, y_{2}\right), C\left(x_{3}, y_{3}\right)$. Note that if at least one of the numbers $x_{1}, x_{2}$, or $x_{3}$ is 0, then $q=0$, and the cubic equation will have only two roots, which contradicts the problem's condition. Then, from the system,

$$
y_{1}=\frac{q}{x_{1}}, \quad y_{2}=\frac{q}{x_{2}}, \quad y_{3}=\frac{q}{x_{3}}
$$

from which

$$
y_{1}+y_{2}+y_{3}=q \frac{x_{1} x_{2}+x_{1} x_{3}+x_{2} x_{3}}{x_{1} x_{2} x_{3}}=0 ; \quad y_{1} y_{2}+y_{2} y_{3}+y_{1} y_{3}=q^{2} \frac{x_{1}+x_{2}+x_{3}}{x_{1} x_{2} x_{3}}=-p q
$$

The point $M$ of intersection of the medians of triangle $A B C$ has coordinates

$$
\left(\frac{1}{3}\left(x_{1}+x_{2}+x_{3}\right), \frac{1}{3}\left(y_{1}+y_{2}+y_{3}\right)\right)
$$

Taking into account Vieta's theorem, we have $M\left(\frac{p}{3}, 0\right)$. Now we will calculate the sum of the squares of the lengths of the sides of triangle $A B C$. It is equal to

$$
\begin{gathered}
\left(x_{1}-x_{2}\right)^{2}+\left(x_{2}-x_{3}\right)^{2}+\left(x_{3}-x_{1}\right)^{2}+\left(y_{1}-y_{2}\right)^{2}+\left(y_{2}-y_{3}\right)^{2}+\left(y_{3}-y_{1}\right)^{2}= \\
=2\left(x_{1}+x_{2}+x_{3}\right)^{2}-6\left(x_{1} x_{2}+x_{2} x_{3}+x_{1} x_{3}\right)+2\left(y_{1}+y_{2}+y_{3}\right)^{2}-6\left(y_{1} y_{2}+y_{2} y_{3}+y_{1} y_{3}\right)=2 p^{2}+6 p q
\end{gathered}
$$

According to the problem's condition, $\left|\frac{p}{3}\right|=2,2 p^{2}+6 p q=324$, from which we find two pairs: $(p ; q)=(6 ; 7)$ or $(p ; q)=(-6 ;-7)$. In both cases, $p q=42$.