Example 7 Given a real number $c \in\left(\frac{1}{2}, 1\right)$. Find the smallest constant $M$, such that for any integer $n \geqslant 2$ and real numbers $0<a_{1} \leqslant a_{2} \leqslant \cdots \leqslant a_{n}$, as long as they satisfy
$$
\frac{1}{n} \sum_{k=1}^{n} k a_{k}=c \sum_{k=1}^{n} a_{k},
$$

we always have $\sum_{k=1}^{n} a_{k} \leqslant M \sum_{k=1}^{m} a_{k}$, where $m=[c n]$ is the greatest integer not exceeding the real number $c n$.
(2002, China Mathematical Olympiad)
Analysis: To find $M$, we need to establish a relationship between $\sum_{k=1}^{n} a_{k}$ and $\sum_{k=1}^{m} a_{k}$. But how can we derive $\sum_{k=1}^{m} a_{k}$ from the given conditions? Given $0<a_{1} \leqslant a_{2} \leqslant \cdots \leqslant a_{n}$ and $m=[c n]$, we think of using Chebyshev's inequality.
Proof: From the given conditions, we have
$$
\sum_{k=1}^{m}(c n-k) a_{k}=\sum_{k=m+1}^{n}(k-c n) a_{k} \text {. }
$$

Since $\frac{1}{2}c n \geqslant m \geqslant 1$.
Notice that $a_{1} \leqslant a_{2} \leqslant \cdots \leqslant a_{m}$,
$$
c n-1 \geqslant c n-2 \geqslant \cdots \geqslant c n-m \text {. }
$$

By Chebyshev's inequality, we get
$$
\begin{array}{l}
\sum_{k=1}^{m}(c n-k) a_{k} \leqslant \frac{1}{m} \sum_{k=1}^{m}(c n-k) \cdot \sum_{k=1}^{m} a_{k} \\
=\left(c n-\frac{m+1}{2}\right) \sum_{k=1}^{m} a_{k} .
\end{array}
$$

Also, $a_{m+1} \leqslant \cdots \leqslant a_{n}, m+1-c n \leqslant \cdots \leqslant n-c n$, by Chebyshev's inequality, we get
$$
\begin{array}{l}
\sum_{k=m+1}^{n}(k-c n) a_{k} \\
\geqslant \frac{1}{n-m} \sum_{k=m+1}^{n}(k-c n) \cdot \sum_{k=m+1}^{n} a_{k} \\
=\left(\frac{m+n+1}{2}-c n\right) \sum_{k=m+1}^{n} a_{k} . \\
\text { Then }\left(c n-\frac{m+1}{2}\right) \sum_{k=1}^{m} a_{k} \\
\geqslant\left(\frac{m+n+1}{2}-c n\right) \sum_{k=m+1}^{n} a_{k} .
\end{array}
$$

Thus, $n \sum_{k=1}^{m} a_{k} \geqslant(m+n+1-2 c n) \sum_{k=1}^{n} a_{k}$.
Hence, $\sum_{k=1}^{n} a_{k} \leqslant \frac{n}{m+n+1-2 c n} \sum_{k=1}^{m} a_{k}$
$$
=\frac{1}{1+\frac{m+1}{n}-2 c^{k=1}} \sum_{k}^{m} \text {. }
$$

Since $m+1>c n$, we have $\frac{1}{1+\frac{m+1}{n}-2 c}0, \\
a_{m+1}=a_{m+2}=\cdots=a_{n}>0\left(a_{m+1} \geqslant a_{m}\right),
\end{array}
$$

and $a_{1}, a_{2}, \cdots, a_{n}$ satisfy the given conditions.
According to the condition for equality in Chebyshev's inequality, the two inequalities above are equalities, i.e.,
$$
\left(c n-\frac{m+1}{2}\right) \sum_{k=1}^{m} a_{k}=\left(\frac{m+n+1}{2}-c n\right) \sum_{k=m+1}^{n} a_{k} \text {. }
$$

Thus, $n \sum_{k=1}^{m} a_{k}=(m+n+1-2 c n) \sum_{k=1}^{n} a_{k}$.
Hence, $\sum_{k=1}^{n} a_{k}=\frac{n}{m+n+1-2 c n} \sum_{k=1}^{m} a_{k}$
$$
=\frac{1}{1+\frac{m+1}{n}-2 c^{k=1}} \sum_{k}^{m} \text {. }
$$

Since $m \leqslant c n$, we have
$$
\frac{1}{1+\frac{m+1}{n}-2 c} \sum_{k=1}^{m} a_{k} \geqslant \frac{1}{1-c+\frac{1}{n}} \sum_{k=1}^{m} a_{k} \text {. }
$$

The above inequality holds for any positive integer $n \geqslant 2$. Therefore, for sufficiently large $n$, we always have
$\sum_{k=1}^{n} a_{k} \geqslant \frac{1}{1-c} \sum_{k=1}^{m} a_{k}$.
Thus, $M \geqslant \frac{1}{1-c}$.
In summary, $M=\frac{1}{1-c}$.
Note: In this problem, the method of separating the sum using Chebyshev's inequality is very typical. This is the main role of Chebyshev's inequality in simplifying multi-variable extremum problems.