#include <bits/stdc++.h>
using namespace std;
struct data {
  long double winLeft, winRight;
  bool empty;
  data() {
    empty = true;
    winLeft = 0;
    winRight = 0;
  }
  data(int p, int q) {
    winLeft = (long double)1.0 * p / q;
    winRight = winLeft;
    empty = false;
  }
};
data merge(data l, data r) {
  if (l.empty && r.empty) return data();
  if (l.empty) return r;
  if (r.empty) return l;
  data res;
  res.empty = false;
  res.winLeft = l.winLeft * r.winLeft / (1 - ((1 - r.winLeft) * l.winRight));
  res.winRight = r.winRight + (1.0 - r.winRight) * l.winRight * r.winLeft /
                                  (1 - ((1 - r.winLeft) * l.winRight));
  return res;
}
struct segmentTree {
  vector<data> tree;
  segmentTree(int n) { tree.resize(4 * n + 17); }
  void change(int v, int tl, int tr, int pos, data val) {
    if (tl == tr) {
      tree[v] = val;
    } else {
      int tm = (tl + tr) / 2;
      if (pos <= tm) {
        change(2 * v, tl, tm, pos, val);
      } else {
        change(2 * v + 1, tm + 1, tr, pos, val);
      }
      tree[v] = merge(tree[2 * v], tree[2 * v + 1]);
    }
  }
  data get(int v, int tl, int tr, int l, int r) {
    if (r < tl || l > tr) return data();
    if (tl >= l && tr <= r) return tree[v];
    int tm = (tl + tr) / 2;
    return merge(get(2 * v, tl, tm, l, r), get(2 * v + 1, tm + 1, tr, l, r));
  }
};
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  segmentTree st(n + 1);
  for (int i = 1; i <= n; i++) {
    int p, qq;
    scanf("%d %d", &p, &qq);
    st.change(1, 1, n, i, data(p, qq));
  }
  for (int i = 1; i <= q; i++) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int pos, p, qq;
      scanf("%d %d %d", &pos, &p, &qq);
      st.change(1, 1, n, pos, data(p, qq));
    } else {
      int l, r;
      scanf("%d %d", &l, &r);
      double res = st.get(1, 1, n, l, r).winLeft;
      printf("%.10lf\n", res);
    }
  }
}
