The total of students in 11th and 12th grade is 30% + 10% = 40% of the students at the school.
The total of students in the 9th and 10th grade is 20% + 40% = 60% of the students at the school.
The difference between the groups is 60% - 40% = 20% of the students at the school. That difference is 100 students, so 20% of the student body is 100 students. Multiplying by 5 tells us 100% of the student body is 500 students.