func_code_string: #include <bits/stdc++.h>   using namespace std;   const double eps = 1e-9;   double ans = 0;   map<double, double> F;   void insert(double dist, double s) {     double need = dist / (s + 1);     F[s] += need;     if (s > 1) F[s] += dist / (s - 1);     ans += need;     while (need > 1e-9) {       map<double, double>::iterator it = --F.end();       double y = it->first;       double dlt = min(need, F[y]);       F[y] -= dlt;       need -= dlt;       ans += dlt / y;       if (F[y] < 1e-9) {         F.erase(it);       }     }   }   int n, L, ls;   int main() {     scanf( %d%d , &n, &L);     int l, r;     double s;     while (n--) {       scanf( %d%d%lf , &l, &r, &s);       insert(l - ls, 1);       insert(r - l, s + 1);       ls = r;     }     insert(L - ls, 1);     printf( %.10lf n , ans);     return 0;   }   