1. Determine the real number $p$ such that the equation

$$
x^{2}+4 p x+5 p^{2}+6 p-16=0
$$

has two distinct roots $x_{1}, x_{2}$ and the sum $x_{1}^{2}+x_{2}^{2}$ is minimized.
1. For the roots $x_{1}, x_{2}$ of the given quadratic equation (if they exist), according to Vièta's formulas, the following equalities hold:

$$
x_{1}+x_{2}=-4 p \quad \text { and } \quad x_{1} x_{2}=5 p^{2}+6 p-16
$$

from which we can compute the desired sum

$$
\begin{aligned}
x_{1}^{2}+x_{2}^{2} & =\left(x_{1}+x_{2}\right)^{2}-2 x_{1} x_{2}=(-4 p)^{2}-2\left(5 p^{2}+6 p-16\right)= \\
& =6 p^{2}-12 p+32=6(p-1)^{2}+26 .
\end{aligned}
$$

From this, the inequality $x_{1}^{2}+x_{2}^{2} \geqq 26$ follows, with equality possible only when $p=1$. We will therefore check whether for $p=1$ the given equation indeed has two distinct solutions: it is the equation $x^{2}+4 x-5=0$ with roots $x_{1}=-5$ and $x_{2}=1$. This solves the problem.

Let us add that most solvers would likely first determine for which $p$ the given equation has two distinct solutions. Since for its discriminant $D$ we have

$$
D=(4 p)^{2}-4\left(5 p^{2}+6 p-16\right)=-4 p^{2}-24 p+64=-4(p+8)(p-2),
$$

such $p$ are precisely the numbers in the interval $(-8,2)$.

Answer: The maximum value of the sum $x_{1}^{2}+x_{2}^{2}$ (equal to 26) corresponds to the single number $p=1$.

For a complete solution, 6 points are awarded, of which 4 points for expressing the sum $x_{1}^{2}+x_{2}^{2}$ as a quadratic function $6 p^{2}-12 p+32$, 1 point for finding its minimum, and 1 point for verifying that at the minimum point $p=1$ the equation indeed has two distinct roots (for example, by finding the interval $p \in(-8,2)$ from the inequality $D>0$).