In a class at school, all students are the same age, except for seven who are 1 year younger and two who are 2 years older.

The sum of the ages of all the students in this class is 330. How many students are in this class?
Let $a$ denote the common age of the students and $n$ the number of students, so we have 7 students aged $a-1$, 2 aged $a+2$, and the rest, that is, $n-9$ aged $a$. Thus, the sum of the ages is

$$
7(a-1)+2(a+2)+(n-9) a=n a-3=330
$$

$\log o$

$$
n a=333=9 \times 37
$$

Since the class has more than 9 students, then $a=9$ and $n=37$, so the class has 37 students.

#