C++ clean solution
\nclass Solution {\npublic:\n    double maxAverageRatio(vector<vector<int>>& classes, int extraStudents) {\n        priority_queue<pair<double,int>> q;\n       
```\nclass Solution {\npublic:\n    double maxAverageRatio(vector<vector<int>>& classes, int extraStudents) {\n        priority_queue<pair<double,int>> q;\n        \n        for(int i=0;i<classes.size();i++){\n            double a=(float)(classes[i][0]+1)/(float)(classes[i][1]+1)-(float)classes[i][0]/(float)classes[i][1];\n            q.push(make_pair(a,i));\n        }\n        for(int j=0;j<extraStudents;j++){\n            int i=q.top().second;\n            classes[i][0]++;\n            classes[i][1]++;\n            double a=(float)(classes[i][0]+1)/(float)(classes[i][1]+1)-(float)classes[i][0]/(float)classes[i][1];\n            q.pop();\n            q.push(make_pair(a,i));\n        }\n        \n        double ans=0;\n        for (int i=0;i<classes.size();i++){\n            ans+=(float)classes[i][0]/(float)classes[i][1];\n        }\n        return ans/classes.size();\n    }\n};\n```
['Greedy', 'C', 'Heap (Priority Queue)']