II. (40 points) Given that there exist integers $x_{1}, x_{2}, \cdots, x_{n}$ $\left(n \in \mathbf{Z}_{+}\right)$, such that
$$
(4 n+1)\left(\sum_{i=1}^{n} x_{i}^{2}-1\right)=4\left(\sum_{i=1}^{n} x_{i}\right)^{2} \text {. }
$$

Find all possible values of $n$ and the corresponding integer solutions
$$
\left(x_{1}, x_{2}, \cdots, x_{n}\right) \text {. }
$$
Let $X=\sum_{i=1}^{n} x_{i}$, and assume $X \geqslant 0$. Otherwise, replace with $-x_{1},-x_{2}, \cdots,-x_{n}$.
Since for all integers $x$, we have $x^{2} \geqslant x$. Then
$$
\sum_{i=1}^{n} x_{i}^{2} \geqslant X \text {. }
$$
(1) If $\sum_{i=1}^{n} x_{i}^{2}=X$, then
$$
x_{i} \in\{0,1\}(i=1,2, \cdots, n) \text {. }
$$

If $x_{i}$ takes $a$ ones, then
$$
(4 n+1)(a-1)=4 a^{2} \text {. }
$$

Thus, $a \neq 0,1$ and $(a-1) \mid 4 a^{2}$.
Since $(a-1, a)=1$, we have $(a-1) \mid 4$.
Also, by $(4 n+1,4)=1$, we know $4 \mid (a-1)$.
Since $a-1>0 \Rightarrow a-1=4 \Rightarrow a=5$.
Thus, $n=6$. In this case, $x_{1}, x_{2}, \cdots, x_{6}$ have exactly five 1s and one 0, i.e.,
$$
\left(x_{1}, x_{2}, \cdots, x_{6}\right)
$$
$=(0,1,1,1,1,1)$ and its permutations.
(2) If $\sum_{i=1}^{n} x_{i}^{2}>X$, by the discreteness of integers, we have
$$
X+1 \leqslant \sum_{i=1}^{n} x_{i}^{2}=\frac{4}{4 n+1} X^{2}+1 \text {. }
$$

Therefore, $X \geqslant n+1$.
By the Cauchy-Schwarz inequality, we know
$X^{2} \leqslant n \sum_{i=1}^{n} x_{i}^{2}=\frac{4 n}{4 n+1} X^{2}+n$
$\Rightarrow X^{2} \leqslant 4 n^{2}+n \Rightarrow X \leqslant 2 n$.
Thus, $1 \leqslant \frac{X}{n} \leqslant 2$.
Notice that,
$$
\begin{array}{l}
\sum_{i=1}^{n}\left(x_{i}-\frac{X}{n}\right)^{2}=\sum_{i=1}^{n} x_{i}^{2}-2 \frac{X}{n} \sum_{i=1}^{n} x_{i}+\frac{X^{2}}{n} \\
=\sum_{i=1}^{n} x_{i}^{2}-\frac{X^{2}}{n}=1-\frac{X^{2}}{n(4 n+1)}<1 .
\end{array}
$$

Hence, $-1<x_{i}-\frac{X}{n}<1(i=1,2, \cdots, n)$
$$
\Rightarrow x_{i} \in\{1,2\}(i=1,2, \cdots, n) \text {. }
$$

If $x_{i}$ takes $b$ twos, then
$$
3 b+n=\frac{4(b+n)^{2}}{4 n+1}+1 \Rightarrow n=\frac{b+1}{4 b-3} \text {. }
$$

Thus, $b=1, n=2$.
In this case, $x_{1} 、 x_{2}$ have exactly one 1 and one 2, i.e., $\left(x_{1}, x_{2}\right)=(1,2)$ or $(2,1)$.
In summary, $n=2$ or 6.
When $n=2$, the solutions are
$$
\left(x_{1}, x_{2}\right)=(1,2),(2,1),(-1,-2),(-2,-1) \text {; }
$$

When $n=6$, the solutions are
$$
\left(x_{1}, x_{2}, \cdots, x_{6}\right)
$$
$=(0,1,1,1,1,1)$ and its permutations,
and
$\left(x_{1}, x_{2}, \cdots, x_{6}\right)$
$=(0,-1,-1,-1,-1,-1)$ and its permutations.