Python solution with Heap - With the idea
The idea is add each student such that their addition increases the particular class average more.\n\nFor this, I maintained a heap in which i keep adding what 
The idea is add each student such that their addition increases the particular class average more.\n\nFor this, I maintained a heap in which i keep adding what will be the change in average with addition of one student to that particular class. i.e., `x/y - (x+1)/(y+1)` will be the negative value of change in average with addition of one student in it.\n\n```\nimport heapq\nclass Solution:\n    def maxAverageRatio(self, classes: List[List[int]], extraStudents: int) -> float:\n        \n        heap=[]\n        for x,y in classes:\n            heapq.heappush(heap, (x/y -(x+1)/(y+1) ,x,y))\n            \n        while extraStudents:\n            extraStudents-=1\n            perc,x,y =heapq.heappop(heap)\n            x+=1\n            y+=1\n            heapq.heappush(heap, (x/y -(x+1)/(y+1) ,x,y))\n\n            #print(heap)\n            \n        return sum(y/z for x,y,z in heap)/len(heap)\n```\n
[]