10. (20 points) Given real numbers
$$
x_{i} \in[-6,10](i=1,2, \cdots, 10), \sum_{i=1}^{10} x_{i}=50 \text {. }
$$

Find the maximum value of $\sum_{i=1}^{10} x_{i}^{2}$, and the conditions that should be satisfied when the maximum value is achieved.
10. Let $a_{i}=x_{i}+6$. Then $a_{i} \in[0,16]$, and
$$
\begin{array}{l}
\sum_{i=1}^{10} a_{i}=110, \\
\sum_{i=1}^{10} a_{i}^{2}=\sum_{i=1}^{10} x_{i}^{2}+12 \sum_{i=1}^{10} x_{i}+360 \\
=\sum_{i=1}^{10} x_{i}^{2}+960 .
\end{array}
$$

When there are at least two numbers in $a_{i}$ that are not both 0 and not both 16, let these two numbers be $p$ and $q$.
$$
\begin{array}{l}
\text { (1) When } p+q \geqslant 16 \text {, since } \\
16^{2}+(p+q-16)^{2}-\left(p^{2}+q^{2}\right) \\
=2 \times 16^{2}+2(q-16) p-32 q \\
>2 \times 16^{2}+2(q-16) \times 16-32 q=0,
\end{array}
$$

thus, without changing the other numbers, replacing $p$ with 16 and $p+q-16$ with $q$ keeps the sum unchanged but increases the sum of squares.
(2) When $p+q<16$,
$$
\begin{array}{l}
0^{2}+(p+q)^{2}-\left(p^{2}+q^{2}\right) \\
=2pq>0,
\end{array}
$$

thus, replacing $p$ with 0 and $p+q$ with $q$ increases the sum of squares.
Given $110=16 \times 6+14$, when six of the $a_{i}$ are 16, three are 0, and one is 14, the maximum value of $\sum_{i=1}^{10} x_{i}^{2}$ is
$$
6 \times 10^{2}+3 \times(-6)^{2}+8^{2}=772 .
$$