#include <bits/stdc++.h>
using namespace std;
struct Node {
  long double l, r;
};
Node merge(Node a, Node b) {
  if (a.l < -1 && a.r < -1) return b;
  if (b.l < -1 && b.r < -1) return a;
  Node c;
  c.l = a.l * b.l / (1 - (1 - b.l) * (1 - a.r));
  c.r = b.r * a.r / (1 - (1 - a.r) * (1 - b.l));
  return c;
}
Node st[3 * 101010];
int n, q;
void upd(int p, long double v, int b = 1, int l = 1, int r = n) {
  if (p < l || p > r) return;
  if (l == r) {
    st[b].l = v;
    st[b].r = 1 - v;
    return;
  }
  int fe = b << 1, fd = fe | 1, mid = (l + r) >> 1;
  upd(p, v, fe, l, mid);
  upd(p, v, fd, mid + 1, r);
  st[b] = merge(st[fe], st[fd]);
}
Node query(int first, int second, int b = 1, int l = 1, int r = n) {
  if (second < l || r < first) {
    Node ret;
    ret.l = -2, ret.r = -2;
    return ret;
  }
  if (first <= l && r <= second) return st[b];
  int fe = b << 1, fd = fe | 1, mid = (l + r) >> 1;
  return merge(query(first, second, fe, l, mid),
               query(first, second, fd, mid + 1, r));
}
int main() {
  scanf("%d%d", &n, &q);
  for (int(i) = (1); (i) < (n + 1); (i)++) {
    int a, b;
    scanf("%d%d", &a, &b);
    upd(i, (long double)a / (long double)b);
  }
  for (int(i) = (0); (i) < (q); (i)++) {
    int tp;
    scanf("%d", &tp);
    if (tp == 1) {
      int p, a, b;
      scanf("%d%d%d", &p, &a, &b);
      upd(p, (long double)a / (long double)b);
    } else {
      int l, r;
      scanf("%d%d", &l, &r);
      Node aux = query(l, r);
      printf("%.10f\n", (double)aux.l);
    }
  }
}
