C++ || Not Very Simple
\nclass node\n{\n    public:\n    int x, y;\n    double z;\n    \n    node(int x, int y, double z)\n    {\n        this -> x = x;\n        this -> y = y;\n     
```\nclass node\n{\n    public:\n    int x, y;\n    double z;\n    \n    node(int x, int y, double z)\n    {\n        this -> x = x;\n        this -> y = y;\n        this -> z = z;\n    }\n};\n\nclass cmp\n{\n    public:\n      bool operator()(node a, node b)\n      {\n          return a.z < b.z;\n      }\n};\n\nclass Solution {\npublic:\n    double maxAverageRatio(vector<vector<int>>& classes, int extraStudents) {\n        int n = classes.size();\n        priority_queue<node, vector<node>, cmp> pq;\n        for(auto x : classes)\n        {\n            double prev = x[0] / (double)x[1];\n            double next = (x[0] + 1) / (double)(x[1] + 1);\n            node nodes(x[0], x[1], next - prev);\n            pq.push(nodes);\n        }\n        while(extraStudents--)\n        {\n            auto temp = pq.top();\n            pq.pop();\n            temp.x++;\n            temp.y++;\n            double prev = temp.x / (double)temp.y;\n            double next = (temp.x + 1) / (double)(temp.y + 1);\n            node nodes(temp.x, temp.y, next - prev);\n            pq.push(nodes);\n        }\n        double ans = 0;\n        while(pq.size() != 0)\n        {\n            auto temp = pq.top();\n            pq.pop();\n            ans += temp.x / (double)temp.y;\n        }\n        return ans / n;\n    }\n};\n```
['C', 'Heap (Priority Queue)', 'C++']