10. Express 2006 as the sum of 5 positive integers $x_{1}, x_{2}, x_{3}, x_{4}, x_{5}$. Let $S=\sum_{1 \leq i<j \leq 5} x_{i} x_{j}$. Find:
(1) When $x_{1}, x_{2}, x_{3}, x_{4}, x_{5}$ take what values, $S$ reaches its maximum value;
(2) Furthermore, for any $1 \leqslant i, j \leqslant 5$ there is $\left|x_{i}-x_{j}\right| \leqslant 2$, when $x_{1}, x_{2}, x_{3}, x_{4}, x_{5}$ take what values, $S$ reaches its minimum value, explain the reason.
10. Solution: (1) First, the set of such $S$ values is bounded, so there must exist a maximum and a minimum. If $x_{1}+x_{2}+x_{3}+x_{4}+x_{5}=$ 2006, and $S=\sum_{1 \leqslant i x_{1} x_{2}$. Rewrite $S$ as
$$
S=\sum_{1 \leqslant i0$. This contradicts the assumption that $S$ achieves its maximum value at $x_{1}, x_{2}, x_{3}, x_{4}, x_{5}$. Therefore, it must be that $\left|x_{i}-x_{j}\right| \leqslant 1,(1 \leqslant i, j \leqslant 5)$. Thus, the maximum value is achieved when $x_{1}=402, x_{2}=x_{3}=x_{4}=x_{5}=401$.
(2) When $x_{1}+x_{2}+x_{3}+x_{4}+x_{5}=2006$ and $\left|x_{i}-x_{j}\right| \leqslant 2$, only the following three cases satisfy the requirements:
( I ) $402,402,402,400,400$;
( II ) $402,402,401,401,400$;
( III ) $402,401,401,401,401$;
The latter two cases can be obtained by adjusting $x_{i}^{\prime}=x_{i}-1, x_{j}^{\prime}=x_{j}+1$ from the first case. According to the proof in the previous part, each adjustment increases the sum $S=\sum_{1 \leqslant i<j \leqslant 5} x_{i} x_{j}$.
Therefore, the minimum value is achieved when $x_{1}=x_{2}=x_{3}=402, x_{4}=x_{5}=400$.