[Python] Greedy Solution using Priority Queue
Explanation\nGreedily take the best current choice using priority queue.\n\n\n# Prove\nFor each class, the delta is decreasing when we add extra students.\nThe 
# **Explanation**\nGreedily take the best current choice using priority queue.\n<br>\n\n# **Prove**\nFor each class, the delta is decreasing when we add extra students.\nThe best local option is always the best.\nIt\'s a loss if we don\'t take it.\n<br>\n\n# **Complexity**\nTime `O(n + klogn)`\nSpace `O(n)`\n<br>\n\n**Python3**\n```py\n    def maxAverageRatio(self, A, k):\n        h = [(a / b - (a + 1) / (b + 1), a, b) for a, b in A]\n        heapify(h)\n        while k:\n            v, a, b = heapq.heappop(h)\n            a, b = a + 1, b + 1\n            heapq.heappush(h, (-(a + 1) / (b + 1) + a / b, a, b))\n            k -= 1\n        return sum(a / b for v, a, b in h) / len(h)\n```\n
[]