Example 6 Given $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}$, if
$$
\frac{1}{n} \sum_{k=1}^{n} k a_{k}=c \sum_{k=1}^{n} a_{k} \text {, }
$$

then $\sum_{k=1}^{n} a_{k} \leqslant M \sum_{k=1}^{m} a_{k}$, where $m=[c n]$ denotes the greatest integer not exceeding $c n$.
(2002, China Mathematical Olympiad)
Explanation: First, according to formula (1), use the special value method to find a lower bound for $M$. The simplest method is to set all $a_{k}$ equal. However, since $c$ is given in advance, setting all $a_{k}$ equal may not satisfy the condition. Therefore, take a step back and set $a_{1}=\cdots=a_{m}$, and $a_{m+1}=\cdots=a_{n}$. Assume $a_{1}=1$, substituting into formula (1) gives:
$$
\begin{array}{l}
\frac{m(m+1)}{2}+\left[\frac{n(n+1)}{2}-\frac{m(m+1)}{2}\right] a_{m+1} \\
=c n\left[m+(n-m) a_{m+1}\right] .
\end{array}
$$

From this, we can solve for
$$
a_{m+1}=\frac{m(2 c n-m-1)}{(n-m)(n+m+1-2 c n)}
$$
(Note that $c n \geqslant m \geqslant 1$ and $c n < m+1 \leqslant n$).
Substituting the chosen set of positive numbers into $\sum_{k=1}^{n} a_{k} \leqslant M \sum_{k=1}^{m} a_{k}$, we get:
$$
m+(n-m) \cdot \frac{m(2 c n-m-1)}{(n-m)(n+m+1-2 c n)}
$$
$\leqslant m M$.
$$
\begin{array}{l}
\text { Then } M \geqslant 1+\frac{2 c n-m-1}{n+m+1-2 c n} \\
=\frac{n}{n+m+1-2 c n} \geqslant \frac{n}{n+1-c n} \\
=\frac{1}{1-c+\frac{1}{n}} .
\end{array}
$$

Since $\frac{1}{1-c+\frac{1}{n}}$ is an increasing function of $n$, we can conjecture that $M \geqslant \frac{1}{1-c}$. To prove that the smallest constant sought is exactly $\frac{1}{1-c}$, we need to show that for any increasing sequence $\left\{a_{n}\right\}$ satisfying formula (1), we always have
$$
\sum_{k=1}^{n} a_{k} \leqslant \frac{1}{1-c} \sum_{k=1}^{m} a_{k} \text {. }
$$

Let $S_{0}=0, S_{k}=\sum_{i=1}^{k} a_{i}, k=1,2, \cdots, n$, by the Abel transformation we get
$$
(n-c n) S_{n}=S_{1}+S_{2}+\cdots+S_{n-1} \text {. }
$$

Now we need to transform the relationship (3) of $S_{1}, S_{2}, \cdots, S_{n}$ into a relationship (2) that only contains $S_{m}$ and $S_{n}$, and we should try to express or limit the range of the various $S_{k}$ using $S_{m}$ and $S_{n}$.
Clearly, when $k \leqslant m$, we have $S_{k} \leqslant S_{m}$. But if we directly amplify $S_{1}$, $S_{2}, \cdots, S_{m-1}$ to $S_{m}$, it might go too far, and we don't need the increasing condition of $\left\{a_{n}\right\}$. By the increasing condition of $\left\{a_{n}\right\}$, when $k \leqslant m$, the average of the first $k$ numbers does not exceed the average of the first $m$ numbers, i.e., $S_{k} \leqslant \frac{k}{m} \cdot S_{m}$.
Also, when $m+1 \leqslant k \leqslant n$, $S_{k}=S_{m}+a_{m+1}+\cdots+a_{k}$. Similarly, by the increasing condition of $\left\{a_{n}\right\}$, the average of the $k-m$ numbers $a_{m+1}, \cdots, a_{k}$ does not exceed the average of the $n-m$ numbers $a_{m+1}, \cdots, a_{n}$. Therefore, when $m+1 \leqslant k \leqslant n$, we have
$$
\begin{array}{l}
S_{k} \leqslant S_{m}+\frac{k-m}{n-m}\left(a_{m+1}+\cdots+a_{n}\right) \\
=\frac{n-k}{n-m} \cdot S_{m}+\frac{k-m}{n-m} \cdot S_{n} . \\
\text { Equation (3) becomes } \\
(n-c n) S_{n} \\
\leqslant \frac{1+\cdots+m}{m} \cdot S_{m}+\frac{(n-m-1)+\cdots+1}{n-m} \cdot S_{m}+ \\
\quad \frac{1+\cdots+(n-1-m)}{n-m} \cdot S_{n} \\
=\frac{n}{2} \cdot S_{m}+\frac{n-m-1}{2} \cdot S_{n} .
\end{array}
$$

Equation (3) becomes
$$
\begin{array}{l} 
\leqslant \frac{1+\cdots+m}{m} \cdot S_{m}+\frac{(n-m-1)+\cdots+1}{n-m} \cdot S_{m}+ \\
\frac{1+\cdots+(n-1-m)}{n-m} \cdot S_{n} \\
= \frac{n}{2} \cdot S_{m}+\frac{n-m-1}{2} \cdot S_{n} . \\
\end{array}
$$

Thus, $S_{n} \leqslant \frac{n}{n+1+m-2 c n} \cdot S_{m}$
$$
\leqslant \frac{n}{n-c n} \cdot S_{m}=\frac{1}{1-c} \cdot S_{m} .
$$