13. (19th IMO) In a finite sequence of real numbers, the sum of any 7 consecutive terms is negative, and the sum of any 11 consecutive terms is positive. How many terms can such a sequence have at most?

保留源文本的换行和格式，翻译结果如下：

13. (19th IMO) In a finite sequence of real numbers, the sum of any 7 consecutive terms is negative, and the sum of any 11 consecutive terms is positive. How many terms can such a sequence have at most?
13. A creative solution is: arrange the sequence $a_{1}, a_{2}, \cdots, a_{n}$ into an array (auxiliary diagram)
$$
\begin{array}{l}
a_{1}, a_{2}, \cdots, a_{7}, \\
a_{2}, a_{3}, \cdots, a_{8}, \\
\ldots \ldots \\
a_{11}, a_{12}, \cdots, a_{12} \\
\ldots \ldots
\end{array}
$$

Then, sum the rows and columns (calculate twice) for the first 11 rows and 7 columns, to get
$$
S=\sum_{i=1}^{7} a_{i}+\sum_{i=2}^{8} a_{i}+\cdots+\sum_{i=11}^{17} a_{i}0 .
$$

This contradiction shows that the number of terms $n<17$. (Necessity, using proof by contradiction)
On the other hand, constructing a 16-term sequence $6,6,-15,6,6,6,-16,6,6,-16,6,6,6,-15,6,6$ satisfies the problem, indicating that such a sequence can have at most 16 terms. (Sufficiency, the sequence construction is not unique)

The British contestant Richard not only solved this problem but also replaced the 7 and 11 in the problem with two coprime positive integers $p$ and $q$, deriving the maximum number of terms as $p+q-2$. Therefore, he deservedly received a special award.