6.92 Let $n$ be a given positive integer, and the sum
$$
\begin{aligned}
\sum_{1 \leqslant i<j \leqslant n}\left|x_{i}-x_{j}\right|= & \left|x_{1}-x_{2}\right|+\left|x_{1}-x_{3}\right|+\cdots+\left|x_{1}-x_{n}\right|+ \\
& \left|x_{2}-x_{3}\right|+\left|x_{2}-x_{4}\right|+\cdots+\left|x_{2}-x_{n}\right|+ \\
& \cdots+\left|x_{n-2}-x_{n-1}\right|+\left|x_{n-2}-x_{n}\right|+\mid x_{n-1}- \\
& x_{n} \mid,
\end{aligned}
$$

where $0 \leqslant x_{i} \leqslant 1, i=1,2, \cdots, n$. Let $S(n)$ denote the maximum possible value of the sum. Find $S(n)$.
[Solution] Without loss of generality, let $0 \leqslant x_{1} \leqslant x_{2} \leqslant \cdots \leqslant x_{n} \leqslant 1$. Let
$$
S=\sum_{1 \leqslant i<j \leqslant n}\left|x_{i}-x_{j}\right|=\sum_{1 \leqslant i<j \leqslant n}\left(x_{j}-x_{i}\right) .
$$

This sum has $C_{n}^{2}$ terms. Each $x_{k}$ appears in $n-1$ of these terms $(1 \leqslant k \leqslant n)$, which are
$$
x_{k}-x_{1}, x_{k}-x_{2}, \cdots, x_{k}-x_{k-1} ; x_{k+1}-x_{k}, x_{k+2}-x_{k}, \cdots, x_{n}-x_{k} .
$$

Therefore,
$$
\begin{aligned}
S & =\sum_{k=1}^{n}\left[(k-1) \cdot x_{k}-(n-k) x_{k}\right] \\
& =\sum_{k=1}^{n}\left[x_{k}(2 k-n-1)\right] .
\end{aligned}
$$

Since when $k<\frac{n+1}{2}$, $2 k-n-1<0$, we have
$$
S \leqslant \sum_{k \geqslant \frac{n+1}{2}}\left[x_{k}(2 k-n-1)\right] .
$$

When $n$ is even,
$$
\begin{aligned}
S & \leqslant \sum_{k=\frac{n}{2}+1}^{n}\left[x_{k}(2 k-n-1)\right] \leqslant \sum_{k=\frac{n}{2}+1}^{n}(2 k-n-1) \\
& =1+3+5+\cdots+(n-1)=\frac{n^{2}}{4} ;
\end{aligned}
$$

When $n$ is odd,
$$
\begin{aligned}
S & \leqslant \sum_{k=\frac{n+1}{2}}^{n}\left[x_{k}(2 k-n-1)\right] \leqslant \sum_{k=\frac{n+1}{2}}^{n}(2 k-n-1) \\
& =2+4+6+\cdots+(n-1)=\frac{n^{2}-1}{4} .
\end{aligned}
$$

In summary, we have
$$
S \leqslant\left[\frac{n^{2}}{4}\right]
$$

On the other hand, if $n$ is even, we can take
$$
x_{1}=x_{2}=\cdots=x_{\frac{n}{2}}=0, x_{\frac{n}{2}+1}=x_{\frac{n}{2}+2}=\cdots=x_{n}=1 \text {, }
$$

making $S=\frac{n^{2}}{4}$.
If $n$ is odd, we can take
$$
x_{1}=x_{2}=\cdots=x \frac{n-1}{2}=0, x_{\frac{n+1}{2}}=x_{\frac{n+3}{2}}=\cdots=x_{n}=1 \text {, }
$$

making $S=\frac{n^{2}-1}{4}$.

Therefore, regardless of what positive integer $n$ is, we have $\quad S(n)=\left[\frac{n^{2}}{4}\right]$.