Problem 9.1. Students from 9A, 9B, and 9C gathered for a line-up. Maria Ivanovna decided to count the number of attendees from each class. She found that there were 27 students from 9A, 29 students from 9B, and 30 students from 9C. Ilya Grigoryevich decided to count the total number of attendees from all three classes, and he got 96 students.

It turned out that when counting the number of students in each class, Maria Ivanovna was off by no more than 2. And when counting the total number of students, Ilya Grigoryevich was off by no more than 4.

How many students from 9A were present at the line-up?
Answer: 29.

Solution. Let $a, b, c$ be the actual number of students from 9 "A", 9 "B", 9 "C" respectively. From Maria Ivanovna's counts, it follows that $a \leqslant 29, b \leqslant 31, c \leqslant 32$, and from Ilya Grigoryevich's counts, it follows that $a+b+c \geqslant 92$. We get that

$$
92 \leqslant a+b+c \leqslant 29+31+32=92
$$

From this, it follows that all the considered inequalities must turn into equalities, in particular $a=29$.