#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int N = 1e5 + 10;
int n;
double pr[N];
pair<double, double> tr[N * 4];
bool ze(double d) { return abs(d) <= eps; }
pair<double, double> mrg(const pair<double, double> &a,
                         const pair<double, double> &b) {
  if (ze(a.first + 1) && ze(a.second + 1)) return b;
  if (ze(b.first + 1) && ze(b.second + 1)) return a;
  double l1 = a.first;
  double r1 = a.second;
  double l2 = b.first;
  double r2 = b.second;
  if (ze(((l2 - 1) * r1 + 1))) return make_pair(0, 0);
  double le = l1 * l2 / ((l2 - 1) * r1 + 1);
  double ri = r2 + (r1 * l2 * (1 - r2)) / (-r1 * (1 - l2) + 1);
  return make_pair(le, ri);
}
void build(int p, int l, int r) {
  if (l == r) {
    tr[p] = make_pair(pr[l], pr[l]);
    return;
  }
  build((p << 1), l, ((l + r) >> 1));
  build((p << 1 | 1), ((l + r) >> 1) + 1, r);
  tr[p] = mrg(tr[(p << 1)], tr[(p << 1 | 1)]);
}
void upd(int p, int l, int r, int x, double val) {
  if (x < l || x > r) return;
  if (l == r) {
    tr[p] = make_pair(val, val);
    return;
  }
  upd((p << 1), l, ((l + r) >> 1), x, val);
  upd((p << 1 | 1), ((l + r) >> 1) + 1, r, x, val);
  tr[p] = mrg(tr[(p << 1)], tr[(p << 1 | 1)]);
}
pair<double, double> query(int p, int l, int r, int ll, int rr) {
  if (rr < l || ll > r) return make_pair(-1, -1);
  if (ll <= l && rr >= r) return tr[p];
  return mrg(query((p << 1), l, ((l + r) >> 1), ll, rr),
             query((p << 1 | 1), ((l + r) >> 1) + 1, r, ll, rr));
}
int main() {
  int q;
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    pr[i] = (double)a / (double)b;
  }
  build(1, 0, n - 1);
  for (int i = 0; i < q; ++i) {
    int ty, a, b;
    scanf("%d%d%d", &ty, &a, &b);
    if (ty == 1) {
      int c;
      scanf("%d", &c);
      upd(1, 0, n - 1, a - 1, (double)b / (double)c);
    } else {
      printf("%.12f\n", query(1, 0, n - 1, a - 1, b - 1).first);
    }
  }
  return 0;
}
