#include using namespace std;  double maxAverageRatio(    vector& arr, int K){        int N = arr.size();          priority_queue q;          for (int i = 0; i < N; i++) {                                  double extra            = (((double)arr[i][0] + 1)               / ((double)arr[i][1] + 1))              - ((double)arr[i][0]                 / (double)arr[i][1]);        q.push(make_pair(extra, i));    }          while (K--) {        int i = q.top().second;        q.pop();                          arr[i][0] += 1;        arr[i][1] += 1;                  double extra            = (((double)arr[i][0] + 1)               / ((double)arr[i][1] + 1))              - ((double)arr[i][0]                 / (double)arr[i][1]);          q.push(make_pair(extra, i));    }          double ans = 0;    for (int i […]

Continue Reading