python heap solution
```\nclass Solution:\n    def maxAverageRatio(self, classes: List[List[int]], e: int) -> float:\n        heap=[]\n        for i,j in classes:\n            diff=
```\nclass Solution:\n    def maxAverageRatio(self, classes: List[List[int]], e: int) -> float:\n        heap=[]\n        for i,j in classes:\n            diff=(i+1)/(j+1)-(i/j)\n            heapq.heappush(heap,(-diff,i,j))\n        while(e>0):\n            diff,i,j=heapq.heappop(heap)\n            i+=1\n            j+=1\n            diff=(i+1)/(j+1)-(i/j)\n            heapq.heappush(heap,(-diff,i,j))\n            e-=1\n        ans=0\n        for diff,i,j in heap:\n            ans+=(i/j)\n        return ans/len(classes)\n
['Heap (Priority Queue)', 'Python', 'Python3']