#include <bits/stdc++.h>
using namespace std;
const int maxn = 120000;
struct sad {
  double m[2][2];
  void _set(double a, double b, double c, double d) {
    m[0][0] = a;
    m[0][1] = b;
    m[1][0] = c;
    m[1][1] = d;
  }
  sad operator*(const sad &b) const {
    sad c;
    c._set(0, 0, 0, 0);
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        for (int k = 0; k < 2; k++) {
          if (m[i][k] > (1e18) || b.m[k][j] > (1e18) || c.m[i][j] > (1e18))
            c.m[i][j] = (1e18) + 1;
          else
            c.m[i][j] += m[i][k] * b.m[k][j];
        }
    return c;
  }
} rs[maxn << 2];
int a[maxn], b[maxn];
void pushup(int rt) { rs[rt] = rs[rt << 1 | 1] * rs[rt << 1]; }
void build(int l, int r, int rt) {
  if (l == r) {
    rs[rt]._set(1.0 * b[l] / a[l], 1 - 1.0 * b[l] / a[l], 1, 0);
    return;
  }
  int m = l + r >> 1;
  build(l, m, rt << 1);
  build(m + 1, r, rt << 1 | 1);
  pushup(rt);
}
void update(int p, int l, int r, int rt) {
  if (l == r) {
    rs[rt]._set(1.0 * b[l] / a[l], 1 - 1.0 * b[l] / a[l], 1, 0);
    return;
  }
  int m = l + r >> 1;
  if (p <= m)
    update(p, l, m, rt << 1);
  else
    update(p, m + 1, r, rt << 1 | 1);
  pushup(rt);
}
sad ans;
void query(int L, int R, int l, int r, int rt) {
  if (L <= l & r <= R) {
    ans = rs[rt] * ans;
    return;
  }
  int m = l + r >> 1;
  if (L <= m) query(L, R, l, m, rt << 1);
  if (m < R) query(L, R, m + 1, r, rt << 1 | 1);
}
int main() {
  int n, q, p, l, r;
  while (~scanf("%d%d", &n, &q)) {
    for (int i = 1; i <= n; i++) scanf("%d%d", &a[i], &b[i]);
    build(1, n, 1);
    while (q--) {
      scanf("%d%d", &p, &l);
      if (p == 1) {
        scanf("%d%d", &a[l], &b[l]);
        update(l, 1, n, 1);
      } else {
        scanf("%d", &r);
        ans._set(1, 0, 0, 1);
        query(l, r, 1, n, 1);
        printf("%f\n", ans.m[0][0] > (1e18) ? 0 : 1.0 / ans.m[0][0]);
      }
    }
  }
  return 0;
}
