Let the total number of pupils be ; let be the percentage of the class who got a A in the first exam (from given we know ); also let be the percentage of the pupils with A in their first exam also got A in their second exam (from given we know ). Now I am going to break the number of pupils in this class into four groups: (1) The pupils who did not get A in either of the two exams; (2) the pupils who got A ONLY in the first exam; (3) the pupils who got A in BOTH exams; (4) the pupils who got A ONLY in the second exam.

Using the variables we assigned earlier and the given information, we can expressed the number of the four groups as:

Group (1):

Group (2):

Group (3):

Group (4):

We know that the sum of the numbers for these four groups should equal to the total number of pupils in the class, hence we have:

which simplifies to . Now we need to do a little analysis, in order to make to be as large as possible, we need the product to be as small as possible. We know and , it is hard to just randomly pick the percentages and here, so lets assume both , we got . However this can not be true, since both percentages need to be strictly greater than , so the largest possible number of pupils in the class will be .

Roy