9.5. What is the maximum number of integers that can be written in a row so that the sum of any five consecutive ones is greater than zero, and the sum of any seven consecutive ones is less than zero?
Answer. Ten.

Solution. The sum of any seven written numbers is negative, while the sum of the five outermost numbers from this seven is positive, which means the sum of the two leftmost and the sum of the two rightmost numbers from this seven are negative. Therefore, the sum of any two adjacent numbers, with at least five more numbers to the right or left, is negative.

This means that if we assume more than ten numbers are written, the sum of any two adjacent numbers is negative.

In every sequence of five consecutive numbers, the sum of all is positive, while the sum of two pairs of adjacent numbers is negative, so the outermost and middle numbers of each five are positive. If there are at least nine (or eleven) numbers, each of them will be the outermost in some five, meaning all written numbers will be positive, which contradicts the condition of the negativity of the sums of sevens. Therefore, the number of written numbers is no more than ten.

Let's construct an example for ten numbers. From the previous reasoning, it follows that the numbers with indices $1,3,5,6,8,10$ should be positive, while the others should be negative. Suppose all positive numbers are equal to ${ }^{x}$, and all negative numbers are equal to ${ }^{-y}$. The sum of any five consecutive numbers will be $3 x-2 y>0$, and the sum of any seven consecutive numbers will be $4 x-3 y<0$, from which $\frac{4}{3} x<y<\frac{3}{2} x$. We can take, for example, $x=5, y=7$, then the desired example will be: 5,-7,5,-7,5,5,-7,5,-7,5.

Grading criteria. Noted that the sum of the two leftmost and the sum of the two rightmost numbers from this seven are negative: 1 point. Noted that if there are more than ten numbers, the sum of any two adjacent numbers is negative: 2 points. Noted that the outermost and middle numbers of each five are positive: 1 point. Noted that if there are at least eleven numbers, all numbers will be positive: 1 point. Any correct example for ten numbers: 2 points.