#include <bits/stdc++.h>
double stl[100000 * 2], str[100000 * 2];
int n;
double f(double pl, double pr, double ql) {
  return pl * ql / (1 - (1 - ql) * pr);
}
double g(double pr, double ql, double qr) {
  return qr + (1 - qr) * pr * ql / (1 - (1 - ql) * pr);
}
void pul(int i) {
  int l = i << 1, r = l | 1;
  stl[i] = f(stl[l], str[l], stl[r]), str[i] = g(str[l], stl[r], str[r]);
}
void build(double *pp) {
  int i;
  for (i = 0; i < n; i++) stl[n + i] = str[n + i] = pp[i];
  for (i = n - 1; i > 0; i--) pul(i);
}
void update(int i, double p) {
  i += n;
  stl[i] = str[i] = p;
  while (i > 1) pul(i >>= 1);
}
double query(int l, int r) {
  double pl = 1, pr = 0, ql = 1, qr = 0;
  for (l += n, r += n; l <= r; l >>= 1, r >>= 1) {
    if ((l & 1) == 1) pl = f(pl, pr, stl[l]), pr = g(pr, stl[l], str[l]), l++;
    if ((r & 1) == 0) ql = f(stl[r], str[r], ql), qr = g(str[r], ql, qr), r--;
  }
  return f(pl, pr, ql);
}
int main() {
  static double pp[100000];
  int q, i;
  scanf("%d%d", &n, &q);
  for (i = 0; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    pp[i] = (double)a / b;
  }
  build(pp);
  while (q--) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int a, b;
      scanf("%d%d%d", &i, &a, &b), i--;
      update(i, (double)a / b);
    } else {
      int l, r;
      scanf("%d%d", &l, &r), l--, r--;
      printf("%f\n", query(l, r));
    }
  }
  return 0;
}
