If the overall average weight has to increase after the new people are added, the average weight of the new entrants has to be higher than 40.
So, n > 40
Consequently, m has to be < 10 (as n + m = 50)
Working with the “differences"? approach, we know that the total additional weight added by “m"? students would be (n - 40) each, above the already existing average of 40. m(n - 40) is the total extra additional weight added, which is shared amongst 40 + m students.
So, m * (n−40)(m+40)(n−40)(m+40) has to be maximum for the overall average to be maximum.
At this point, use the trial and error approach (or else, go with the answer options) to arrive at the answer.
The maximum average occurs when m = 5, and n = 45
And the average is 40 + (45 – 40) * 545545 = 40 + 5959 = 40.56 kgs
The question is "what is the maximum possible average weight of the class now?"
Hence, the answer is "40.56 kgs".