c++
Code
# Code\n```cpp []\nclass Solution {\npublic:\ndouble rate_checker(int student,int total){\nreturn (double) (student+1)/(total+1)- (double) student/total;\n}\n    double maxAverageRatio(vector<vector<int>>& c, int e) {\n        double ans=0.0;\n        priority_queue<pair<double,pair<int,int>>>q;\n        for(auto x:c) q.push({rate_checker(x[0],x[1]),{x[0],x[1]}});\n        while(e){\n        auto topu=q.top();\n        q.pop();\n        int first=topu.second.first;\n        int second=topu.second.second;\n        first++;\n        second++;\n         q.push({rate_checker(first,second),{first,second}});\n         e--;\n        }\n        while(!q.empty()){\n            auto tope=q.top();\n            q.pop();\n            ans+=(double) tope.second.first/tope.second.second;\n        }\n        return ans/c.size();\n    }\n};\n```
['Array', 'Greedy', 'Heap (Priority Queue)', 'C++']