#include <bits/stdc++.h>
using namespace std;
int n, q;
double tree[400005];
double tree2[400005];
double p[400005];
double m(double x, double y, double x2) {
  if (x < -1) return y;
  if (y < -1) return x;
  return x * y * (1 / (1 - ((1 - x2) * (1 - y))));
}
void build(int i, int l, int r) {
  if (l == r) {
    tree[i] = p[l];
    tree2[i] = 1 - p[l];
    return;
  }
  build(i * 2 + 1, l, (l + r) / 2);
  build(i * 2 + 2, (l + r) / 2 + 1, r);
  tree[i] = m(tree[i * 2 + 1], tree[i * 2 + 2], tree2[i * 2 + 1]);
  tree2[i] = m(tree2[i * 2 + 2], tree2[i * 2 + 1], tree[i * 2 + 2]);
}
void upd(int i, int l, int r, int x, double val) {
  if (l == r && l == x) {
    tree[i] = val;
    tree2[i] = 1 - val;
    return;
  }
  if (r < x || l > x) return;
  upd(i * 2 + 1, l, (l + r) / 2, x, val);
  upd(i * 2 + 2, (l + r) / 2 + 1, r, x, val);
  tree[i] = m(tree[i * 2 + 1], tree[i * 2 + 2], tree2[i * 2 + 1]);
  tree2[i] = m(tree2[i * 2 + 2], tree2[i * 2 + 1], tree[i * 2 + 2]);
}
pair<double, double> query(int i, int l, int r, int x, int y) {
  if (l > y || r < x) return make_pair(-2.0, -2.0);
  if (l >= x && r <= y) return make_pair(tree[i], tree2[i]);
  pair<double, double> L = query(i * 2 + 1, l, (l + r) / 2, x, y);
  pair<double, double> R = query(i * 2 + 2, (l + r) / 2 + 1, r, x, y);
  pair<double, double> res;
  res.first = m(L.first, R.first, L.second);
  res.second = m(R.second, L.second, R.first);
  return res;
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    p[i] = (1.0 * a) / b;
  }
  build(0, 0, n - 1);
  while (q--) {
    int com;
    scanf("%d", &com);
    if (com == 1) {
      int i, a, b;
      scanf("%d %d %d", &i, &a, &b);
      i--;
      p[i] = (1.0 * a) / b;
      upd(0, 0, n - 1, i, p[i]);
    } else {
      int l, r;
      scanf("%d %d", &l, &r);
      l--;
      r--;
      printf("%.7lf\n", query(0, 0, n - 1, l, r).first);
    }
  }
}
