#include <bits/stdc++.h>
using namespace std;
int n, q;
double p[100005];
pair<double, double> merge(pair<double, double> p, pair<double, double> q) {
  if (p.first == -1.0) return q;
  if (q.first == -1.0) return p;
  double a = p.first, b = p.second, c = q.first, d = q.second;
  return pair<double, double>(a * c / (1 - b + b * c),
                              d + (1 - d) * b * c / (1 - b + b * c));
}
struct segtree {
  pair<double, double> res[4 * 100005];
  void pushup(int k) { res[k] = merge(res[k * 2], res[k * 2 + 1]); }
  void build(int k, int l, int r) {
    if (l == r) {
      res[k] = pair<double, double>(p[l], p[l]);
      return;
    }
    int mid = (l + r) / 2;
    build(k * 2, l, mid);
    build(k * 2 + 1, mid + 1, r);
    pushup(k);
  }
  void update(int k, int l, int r, int p, double v) {
    if (l == r) {
      res[k] = pair<double, double>(v, v);
      return;
    }
    int mid = (l + r) / 2;
    if (p <= mid)
      update(k * 2, l, mid, p, v);
    else
      update(k * 2 + 1, mid + 1, r, p, v);
    pushup(k);
  }
  pair<double, double> query(int k, int l, int r, int x, int y) {
    if (l > y || x > r) return pair<double, double>(-1.0, -1.0);
    if (l >= x && r <= y) return res[k];
    int mid = (l + r) / 2;
    return merge(query(k * 2, l, mid, x, y),
                 query(k * 2 + 1, mid + 1, r, x, y));
  }
} seg;
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    p[i] = (double)a / b;
  }
  seg.build(1, 1, n);
  for (int i = 0; i < q; i++) {
    int type, l, r, a, b, x;
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d%d%d", &x, &a, &b);
      double pp = (double)a / b;
      seg.update(1, 1, n, x, pp);
    } else {
      scanf("%d%d", &l, &r);
      pair<double, double> ret = seg.query(1, 1, n, l, r);
      printf("%.10f\n", ret.first);
    }
  }
  return 0;
}
