There are 2 points in this questions that are not phased correctly.
(1) and 4 times as many pupils withdrew from Classroom B than A. (This phrasing is discouraged to be used many years back already)
Should be 4 times as many pupils withdrew from Classroom B as A.
If not, ‘than’ indicates more by 4 times –> altogether 5 times as many as.
So question comparison requirement is unclear.
(2) number of pupils in Classroom B would be 3 times as many as that in Classroom A.
After more pupils withdrew from Classroom B than A, there should be fewer pupils remained than in A, not more pupils.