func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 100010;   const int MAXM = 20010;   const int MAXNODE = 16 * MAXN;   const int LOGMAXN = 50;   const int INF = 0x3f3f3f3f;   const double eps = 1e-9;   int N, M;   int b[MAXM], z[MAXM], x[3 * (MAXN + MAXM)];   struct Tree {     int x, h;     double l, r;   } a[MAXN];   struct SegmentTree {     double mul[MAXNODE];     void build(int o, int L, int R) {       mul[o] = 1;       if (L >= R) return;       int mid = L + (R - L) / 2;       build(o << 1, L, mid);       build(o << 1 | 1, mid + 1, R);     }     void pushdown(int o) {       mul[o << 1] *= mul[o];       mul[o << 1 | 1] *= mul[o];       mul[o] = 1;     }     void update(int o, int L, int R, int ql, int qr, double p) {       if (ql <= L && qr >= R) {         mul[o] *= p;         return;       }       pushdown(o);       int mid = L + (R - L) / 2;       if (ql <= mid) update(o << 1, L, mid, ql, qr, p);       if (qr > mid) update(o << 1 | 1, mid + 1, R, ql, qr, p);     }     double query(int o, int L, int R, int pos) {       if (L >= R) return mul[o];       pushdown(o);       int mid = L + (R - L) / 2;       double ans;       if (pos <= mid)         ans = query(o << 1, L, mid, pos);       else         ans = query(o << 1 | 1, mid + 1, R, pos);       return ans;     }   } tree;   int main() {     while (scanf( %d%d , &N, &M) != EOF) {       int k = 0;       for (int i = 0; i < N; i++) {         scanf( %d%d%lf%lf , &a[i].x, &a[i].h, &a[i].l, &a[i].r);         a[i].l /= 100;         a[i].r /= 100;         x[k++] = a[i].x;         x[k++] = a[i].x - a[i].h;         x[k++] = a[i].x + a[i].h;       }       for (int i = 0; i < M; i++) {         scanf( %d%d , &b[i], &z[i]);         x[k++] = b[i];       }       sort(x, x + k);       k = unique(x, x + k) - x;       tree.build(1, 1, k);       for (int i = 0; i < N; i++) {         int qm = lower_bound(x, x + k, a[i].x) - x + 1;         int ql = lower_bound(x, x + k, a[i].x - a[i].h) - x + 1,             qr = lower_bound(x, x + k, a[i].x + a[i].h) - x + 1;         tree.update(1, 1, k, ql, qm - 1, (1 - a[i].l));         tree.update(1, 1, k, qm + 1, qr, (1 - a[i].r));       }       double ans = 0;       for (int i = 0; i < M; i++) {         int pos = lower_bound(x, x + k, b[i]) - x + 1;         ans += z[i] * tree.query(1, 1, k, pos);       }       printf( %.10lf n , ans);     }     return 0;   }   