func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 100000 + 10;   struct TreeNode {     int L, R;     pair<double, double> val;   } tree[maxn << 2];   int a[maxn], b[maxn], n, q;   void pushUp(int root) {     tree[root].val.first =         tree[root << 1].val.first * tree[root << 1 | 1].val.first;     tree[root].val.second =         tree[root << 1].val.second +         tree[root << 1].val.first * tree[root << 1 | 1].val.second;   }   void build(int L, int R, int root) {     tree[root].L = L;     tree[root].R = R;     if (L == R) {       return;     }     int mid = (L + R) >> 1;     build(L, mid, root << 1);     build(mid + 1, R, root << 1 | 1);   }   void update(int pos, pair<double, double> val, int root) {     int L = tree[root].L, R = tree[root].R;     if (L == R) {       tree[root].val = val;       return;     }     int mid = (L + R) >> 1;     if (pos <= mid) {       update(pos, val, root << 1);     } else {       update(pos, val, root << 1 | 1);     }     pushUp(root);   }   pair<double, double> query(int ql, int qr, int root) {     int L = tree[root].L, R = tree[root].R;     if (L >= ql && R <= qr) return tree[root].val;     int mid = (L + R) >> 1;     pair<double, double> a = make_pair(1.0, 0.0), b = make_pair(1.0, 0.0), c;     if (ql <= mid) {       a = query(ql, qr, root << 1);     }     if (qr > mid) {       b = query(ql, qr, root << 1 | 1);     }     c.first = a.first * b.first;     c.second = a.second + a.first * b.second;     return c;   }   int main() {     cin >> n >> q;     build(1, n, 1);     for (int i = 1; i <= n; i++) {       double x, y;       cin >> x >> y;       double p = x / y;       update(i, make_pair((1 - p) / p, (1 - p) / p), 1);     }     while (q--) {       int type;       cin >> type;       if (type == 1) {         int i, x, y;         scanf( %d%d%d , &i, &x, &y);         double p = double(x) / y;         update(i, make_pair((1.0 - p) / p, (1.0 - p) / p), 1);       } else {         int l, r;         scanf( %d%d , &l, &r);         pair<double, double> t = query(l, r, 1);         double p = t.second;         if (p < 1e20)           printf( %.6lf n , 1.0 / (1 + p));         else           cout <<  0.0000000  << endl;       }     }     return 0;   }   