Initialize a max heap to store pairs of delta and class index.
Calculate the initial delta for each class and add it to the heap.
While there are extra students:
a. Extract the class with the maximum delta from the heap.
b. Assign an extra student to this class.
c. Recalculate the delta for this class.
d. Add the updated class back to the heap.
After all extra students are assigned, calculate the final average pass ratio.
Brute Force Approach with Iterative Student Assignment