Problem: Let $a_1$, $a_2$, \dots, $a_n$ be a sequence of real numbers,
and let $m$ be a fixed positive integer less than $n$.
We say an index $k$ with $1 \le k \le n$ is \textit{good} if there exists
some $\ell$ with $1 \le \ell \le m$ such that
\[ a_k + a_{k + 1} + \dotsb + a_{k + \ell - 1} \ge 0, \]
where the indices are taken modulo $n$.
Let $T$ be the set of all good indices. Prove that
\[ \sum_{k \in T} a_k \ge 0. \]

Solution: First we prove the result if the indices are not taken modulo $n$.
Call a number $\ell$-good if $\ell$ is the \emph{smallest} number
such that $a_k + a_{k+1} + \dots + a_{k+\ell-1} \ge 0$, and $\ell \le m$.
Then if $a_k$ is $\ell$-good,
the numbers $a_{k+1}, \dots, a_{k+\ell-1}$ are good as well.

Then by greedy from left to right,
we can group all the good numbers into blocks with nonnegative sums.
Repeatedly take the first good number,
if $\ell$-good, group it with the next $\ell$ numbers.
An example for $m = 3$:
\[ \langle 4 \rangle
  \quad \langle -1 \quad -2 \quad 6 \rangle
  \quad -9
  \quad -7
  \quad \langle 3 \rangle
  \quad \langle -2 \quad 4 \rangle
  \quad \langle -1. \]

We can now return to the original problem.
Let $N$ be a large integer; applying the algorithm to
$N$ copies of the sequence, we deduce that
\[ N \sum_{k \in T} a_k + c_N \ge 0 \]
where $c_N$ represents some ``error'' from left-over terms.
As $|c_N| \le \sum |a_i|$, by taking $N$ large enough we deduce the problem.

\begin{remark*}
  This solution was motivated by looking at the case $m = 1$,
  realizing how dumb it was, then looking at $m = 2$,
  and realizing it was equally dumb.
\end{remark*}