Set up a class with X students passing, and a class with Y students.
Total number of people passing Class One and Class Two: 100*0.84=84 (person)
X/Y = 0.8(84-X)/( 100-Y)= 0.9
X=48 Y=60 by combining two solutions.
So class one has 60 people, and class two 100-60=40 people.