6. Given that $n, k$ are positive integers, $n>k$. Given real numbers $a_{1}, a_{2}, \cdots, a_{n} \in(k-1, k)$. Let positive real numbers $x_{1}, x_{2}$, $\cdots, x_{n}$ satisfy that for any $k$-element subset $I$ of $\{1,2, \cdots, n\}$, we have $\sum_{i \in I} x_{i} \leqslant \sum_{i \in I} a_{i}$. Find the maximum value of $x_{1} x_{2} \cdots x_{n}$.
6. The maximum value is $a_{1} a_{2} \cdots a_{n}$.

If $x_{i}=a_{i}(1 \leqslant i \leqslant n)$, then $x_{1}, x_{2}, \cdots, x_{n}$ satisfy the conditions, and $x_{1} x_{2} \cdots x_{n}=a_{1} a_{2} \cdots a_{n}$.
Next, we prove: $x_{1} x_{2} \cdots x_{n} \leqslant a_{1} a_{2} \cdots a_{n}$.
When $k=1$, the conclusion is obvious. By the condition, we have
$$
x_{i} \leqslant a_{i}(1 \leqslant i \leqslant n) \text {. }
$$

Now assume $k \geqslant 2$.
Without loss of generality, let
$$
a_{1}-x_{1} \leqslant a_{2}-x_{2} \leqslant \cdots \leqslant a_{n}-x_{n} \text {. }
$$

If $a_{1}-x_{1} \geqslant 0$, then $a_{i} \geqslant x_{i}(1 \leqslant i \leqslant n)$, and the conclusion is obviously true.
Assume $a_{1}-x_{1} < 0$, \\
$0 \leqslant d_{s+1} \leqslant \cdots \leqslant d_{k} \leqslant \cdots \leqslant d_{n} .
\end{array}
$$

From equation (1), we know
$$
-\sum_{i=1}^{s} d_{i}+\sum_{i=s+1}^{k} d_{i} \geqslant 0 \Rightarrow \sum_{i=s+1}^{k} d_{i} \geqslant \sum_{i=1}^{s} d_{i} .
$$

Let $M=\sum_{i=1}^{s} d_{i}, N=\sum_{i=s+1}^{n} d_{i}$. Then
$$
\frac{N}{n-s}=\frac{\sum_{i=s+1}^{n} d_{i}}{n-s} \geqslant \frac{\sum_{i=s+1}^{k} d_{i}}{k-s} \geqslant \frac{M}{k-s} \text {. }
$$

Notice that, for $j>s$, we have $d_{j}<a_{j}<k$.
Using the AM-GM inequality, we get
$$
\begin{array}{l}
\prod_{i=1}^{n} \frac{x_{i}}{a_{i}}=\left(\prod_{i=1}^{s}\left(1+\frac{d_{i}}{a_{i}}\right)\right)\left(\prod_{j=s+1}^{n}\left(1-\frac{d_{j}}{a_{j}}\right)\right) \\
\leqslant\left(\prod_{i=1}^{s}\left(1+\frac{d_{i}}{k-1}\right)\right)\left(\prod_{j=s+1}^{n}\left(1-\frac{d_{j}}{k}\right)\right) \\
\leqslant\left(\frac{1}{n}\left(\sum_{i=1}^{s}\left(1+\frac{d_{i}}{k-1}\right)+\sum_{i=s+1}^{n}\left(1-\frac{d_{i}}{k}\right)\right)\right)^{n} \\
=\left(1+\frac{M}{n(k-1)}-\frac{N}{n k}\right)^{n} \\
\leqslant\left(1+\frac{M}{n(k-1)}-\frac{(n-s) M}{n k(k-s)}\right)^{n} \\
\leqslant\left(1+\frac{M}{n(k-1)}-\frac{(k+1-s) M}{n k(k-s)}\right)^{n} \\
=\left(1+\frac{M}{n k}\left(\frac{k}{k-1}-\frac{k-s+1}{k-s}\right)\right)^{n} \\
\leqslant 1 .
\end{array}
$$

Thus, the conclusion is proved.