Explanation:
elementary school has 651 students and 31 teachers.
the teacher/student ratio is therefore 31/651 or simplified 1/21.
elementary and middle school together have 1197 students. that means the middle school has
1197 - 651 = 546 students
their teacher student ratio is then
x/546
and that must be the same as for the elementary school.
so,
x/546 = 1/21
x = 546/21 = 26
so, the middle school has 26 teachers.