func_code_string: #include <bits/stdc++.h>   using namespace std;   struct Dev {     int p;     int e;     long double t;   } d[100000];   int n, p;   bool fun(long double midTime) {     long double energy = 0, t;     for (int i = 0; i < n; i++) {       t = midTime - d[i].t;       if (t > 0) energy += t * d[i].p;     }     return midTime * p >= energy;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n >> p;     long long sumPow = 0;     for (int i = 0; i < n; i++) {       cin >> d[i].p >> d[i].e;       d[i].t = (double)d[i].e / d[i].p;       sumPow += d[i].p;     }     if (sumPow <= p) {       cout << -1 << endl;       return 0;     }     long double minTime = 0;     long double maxTime = 1e18;     long double midTime;     for (int i = 0; i < 80; i++) {       midTime = (minTime + maxTime) / 2;       if (fun(midTime))         minTime = midTime;       else         maxTime = midTime;     }     if (midTime > 1e18 - 100)       cout << -1 << endl;     else       cout << midTime << endl;     return 0;   }   