Because the number of people is constant, you can grasp this amount and read the questions again.
"If there are 8 people in each room, there will be less 12 beds." The known number is 8* rooms+12.
"If there are 9 people living in each room, but two dormitories are vacant", the number of people is 9* (the number of rooms is -2).
So there are 8* rooms+12=9* (room number -2).
Find here, and you can start asking for results!
Solution: There are X dormitories.
8x+ 12=9(x-2)
8x+ 12=9x- 18
x=30
So the total number of people is 30*8+ 12=252 (people).
A: * * * There are 252 people.