In Mrs. Warner's class, there are 30 students. Strangely, 15 of the students have a height of $1.60 \mathrm{~m}$ and 15 of the students have a height of $1.22 \mathrm{~m}$. Mrs. Warner lines up $n$ students so that the average height of any four consecutive students is greater than $1.50 \mathrm{~m}$ and the average height of any seven consecutive students is less than $1.50 \mathrm{~m}$. What is the largest possible value of $n$ ?
(A) 8
(B) 12
(C) 11
(D) 9
(E) 10
We refer to the students with height $1.60 \mathrm{~m}$ as "taller" students and to those with height $1.22 \mathrm{~m}$ as "shorter" students.

For the average of four consecutive heights to be greater than $1.50 \mathrm{~m}$, the sum of these four heights must be greater than $4 \times 1.50 \mathrm{~m}=6.00 \mathrm{~m}$.

If there are 2 taller and 2 shorter students, then the sum of their heights is $2 \times 1.60 \mathrm{~m}+2 \times 1.22 \mathrm{~m}$ or $5.64 \mathrm{~m}$, which is not large enough.

Therefore, there must be more taller and fewer shorter students in a given group of 4 consecutive students.

If there are 3 taller students and 1 shorter student, then the sum of their heights is equal to $3 \times 1.60 \mathrm{~m}+1 \times 1.22 \mathrm{~m}$ or $6.02 \mathrm{~m}$, which is large enough.

Thus, in Mrs. Warner's line-up, any group of 4 consecutive students must include at least 3 taller students and at most 1 shorter student. ( 4 taller and 0 shorter students also give an average height that is greater than $1.50 \mathrm{~m}$.)

For the average of seven consecutive heights to be less than $1.50 \mathrm{~m}$, the sum of these seven heights must be less than $7 \times 1.50 \mathrm{~m}=10.50 \mathrm{~m}$.

Note that 6 taller students and 1 shorter student have total height $6 \times 1.60 \mathrm{~m}+1 \times 1.22 \mathrm{~m}$ or $10.82 \mathrm{~m}$ and that 5 taller students and 2 shorter students have total height equal to $5 \times 1.60 \mathrm{~m}+2 \times 1.22 \mathrm{~m}$ or $10.44 \mathrm{~m}$.

Thus, in Mrs. Warner's line-up, any group of 7 consecutive students must include at most 5 taller students and at least 2 shorter students.

Now, we determine the maximum possible length for a line-up. We use " $\mathrm{T}$ " to represent a taller student and "S" to represent a shorter student.

After some fiddling, we discover the line-up TTSTTTSTT.

The line-up TTSTTTSTT has length 9 and has the property that each group of 4 consecutive students includes exactly 3 T's and each group of 7 consecutive students includes exactly 5 Ts and so has the desired average height properties.

We claim that this is the longest such line-up, which makes the final answer 9 or (D).

Suppose that there was a line-up of length at least 10, and the first 10 heights in the line-up were abcdefghjk. Consider the following table of heights:

| $a$ | $b$ | $c$ | $d$ | $e$ | $f$ | $g$ |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| $b$ | $c$ | $d$ | $e$ | $f$ | $g$ | $h$ |
| $c$ | $d$ | $e$ | $f$ | $g$ | $h$ | $j$ |
| $d$ | $e$ | $f$ | $g$ | $h$ | $j$ | $k$ |

We explain why this table demonstrates that it is not possible to have at least 10 in the line-up. Each row in this table is a list of 7 consecutive people from the line-up abcdefghjk and so its sum is less than $10.50 \mathrm{~m}$.

Each column in this table is a list of 4 consecutive people from the line-up abcdefghjk and so its sum is greater than $6.00 \mathrm{~m}$.

The sum of the numbers in this table equals the sum of the sums of the 4 rows, which must be less than $4 \times 10.50 \mathrm{~m}$ or $42.00 \mathrm{~m}$.

The sum of the numbers in this table equals the sum of the sums of the 7 columns, which must be greater than $7 \times 6.00 \mathrm{~m}$ or $42.00 \mathrm{~m}$.

The sum cannot be both less than and greater than $42.00 \mathrm{~m}$.

This means that our assumption is incorrect, and so it must be impossible to have a line-up of length 10 or greater.

(There are a number of other ways to convince yourself that there cannot be more than 9 students in the line-up.)