go heap
\nfunc maxAverageRatio(classes [][]int, extraStudents int) float64 {\n    h := &maxheap{}\n    for _, c := range classes {\n        heap.Push(h, [2]int{c[0], c[
```\nfunc maxAverageRatio(classes [][]int, extraStudents int) float64 {\n    h := &maxheap{}\n    for _, c := range classes {\n        heap.Push(h, [2]int{c[0], c[1]})\n    }\n    \n    for extraStudents > 0 {\n        c := heap.Pop(h).([2]int)\n        extraStudents--\n        c[0]++\n        c[1]++\n        heap.Push(h, c)\n    }\n    var res float64\n    for _, v := range *h {\n        res += float64(v[0]) / float64(v[1])\n    }\n    return res / float64(len(classes))\n}\n\ntype maxheap [][2]int\n\nfunc (h maxheap) Len() int {\n    return len(h)\n}\n\nfunc (h maxheap) Less(i int, j int) bool {\n    return float64(h[i][0] + 1) / float64(h[i][1] + 1) - float64(h[i][0]) / float64(h[i][1]) >\n    float64(h[j][0] + 1) / float64(h[j][1] + 1) - float64(h[j][0]) / float64(h[j][1])\n}\n\nfunc (h maxheap) Swap(i int, j int) {\n    h[i], h[j] = h[j], h[i]\n}\n\nfunc (h *maxheap) Push(a interface{}) {\n    *h = append(*h, a.([2]int))\n}\n\nfunc (h *maxheap) Pop() interface{} {\n    l := len(*h)\n    res := (*h)[l - 1]\n    *h = (*h)[:l - 1]\n    return res\n}\n```
['Go']