8. Given a positive integer $n(n>1)$, $n$ real numbers $x_{1}, x_{2}$, $\cdots, x_{n}$ satisfy $x_{1}, x_{2}, \cdots, x_{n} \in[0, n]$, and
$$
x_{1} x_{2} \cdots x_{n}=\left(n-x_{1}\right)\left(n-x_{2}\right) \cdots\left(n-x_{n}\right) \text {. }
$$

Determine the maximum value of $y=x_{1}+x_{2}+\cdots+x_{n}$.
8. The maximum value is $n^{2}-n$.

Let $y_{k}=\frac{x_{k}}{n}(k=1,2, \cdots, n)$.
Thus, $y_{k} \in[0,1], \prod_{k=1}^{n} y_{k}=\prod_{k=1}^{n}\left(1-y_{k}\right)$.
If there exists $y_{k}=0$, then $\prod_{k=1}^{n} y_{k} \leqslant n-1$.
If for any $1 \leqslant k \leqslant n$, $y_{k}>0$, then $y_{k}<1$.
Let $z_{k}=\frac{y_{k}}{1-y_{k}}(k=1,2, \cdots, n)$.
Thus, $y_{k}=\frac{z_{k}}{1+z_{k}}$, and $\prod_{k=1}^{n} z_{k}=1$.
Assume without loss of generality that $z_{1} \leqslant z_{2} \leqslant \cdots \leqslant z_{n}$. Then $z_{1} z_{2} \leqslant 1$.
Therefore, $\sum_{k=1}^{n} y_{k}=\sum_{k=1}^{n} \frac{z_{k}}{1+z_{k}}$
$=\frac{z_{1}+z_{2}+2 z_{1} z_{2}}{1+z_{1}+z_{2}+z_{1} z_{2}}+\sum_{k=3}^{n} \frac{z_{k}}{1+z_{k}} \leqslant n-1$.
Thus, $y=\sum_{k=1}^{n} x_{k}=n \sum_{k=1}^{n} y_{k} \leqslant n^{2}-n$.
Furthermore, when $x_{1}, x_{2}, \cdots, x_{n}$ have exactly $n-1$ values of $n$ and 1 value of 0, $y=n^{2}-n$.
Therefore, the maximum value sought is $n^{2}-n$.