C++ Solution
\ndouble precise(double a)\n{\n   double  intpart;\n   double fractpart = modf (a, &intpart);\n   fractpart  = roundf(fractpart * 100000.0)/100000.0; // Round t
```\ndouble precise(double a)\n{\n   double  intpart;\n   double fractpart = modf (a, &intpart);\n   fractpart  = roundf(fractpart * 100000.0)/100000.0; // Round to 5 decimal places\n   double b = intpart + fractpart;\n    return b;\n}\nclass Solution {\npublic:\n    double maxAverageRatio(vector<vector<int>>& classes, int extraStudents) {\n        int min_index= 0;\n        double min_ratio= 0.00000, sum= 0.0;\n        double cur_ratio= 0.0, new_ratio= 0.0;\n        vector<double> ratio;\n        int l= classes.size();\n        multimap<double, int> mp;\n        setprecision(5);\n        for(int i= 0; i<l ;i++)\n        {\n            mp.insert({((double)classes[i][1]-(double)classes[i][0])/((double)classes[i][1]*((double)classes[i][1]+1)), i});\n            ratio.push_back((double)classes[i][0]/(double)classes[i][1]);\n        }\n        for(int i= 0;i< extraStudents; i++)\n        {\n            int j= (--mp.end())->second;\n            classes[j][0]+= 1;\n            classes[j][1]+= 1;\n            ratio[j]= (double)classes[j][0]/(double)classes[j][1];\n            mp.erase(--mp.end());\n            mp.insert({((double)classes[j][1]-(double)classes[j][0])/((double)classes[j][1]*((double)classes[j][1]+1)), j});\n        }\n        for(int i= 0;i< l;i++)\n        {\n            sum+= ratio[i];\n            cout<<ratio[i]<<\'\\n\';\n        }\n        int k= (sum/l)*1e5;\n        min_ratio= k/1e5;\n        return min_ratio;\n    }\n};\n```
[]