#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
long double l[N << 2], r[N << 2];
long double p[N << 2];
void update(int node) {
  l[node] = l[node << 1] * l[node << 1 | 1] /
            (-r[node << 1] * (-l[node << 1 | 1] + 1) + 1);
  r[node] = r[node << 1 | 1] +
            (-r[node << 1 | 1] + 1) * r[node << 1] * l[node << 1 | 1] /
                (-r[node << 1] * (-l[node << 1 | 1] + 1) + 1);
}
void build(int node, int tl, int tr) {
  int m;
  if (tl == tr) {
    r[node] = l[node] = p[tl];
    return;
  }
  m = tl + tr >> 1;
  build(node << 1, tl, m);
  build(node << 1 | 1, m + 1, tr);
  update(node);
}
void modify(int node, int tl, int tr, int x, long double d) {
  int m;
  if (tl > x || tr < x) return;
  if (tl == tr) {
    l[node] = d;
    r[node] = d;
    return;
  }
  m = tl + tr >> 1;
  modify(node << 1, tl, m, x, d);
  modify(node << 1 | 1, m + 1, tr, x, d);
  update(node);
}
inline pair<long double, long double> bound(long double l1, long double r1,
                                            long double l2, long double r2) {
  pair<long double, long double> tmp;
  tmp.first = l1 * l2 / (-r1 * (-l2 + 1) + 1);
  tmp.second = r2 + (-r2 + 1) * r1 * l2 / (-r1 * (-l2 + 1) + 1);
  return tmp;
}
pair<long double, long double> query(int node, int tl, int tr, int fl, int fr) {
  int m;
  pair<long double, long double> tmp, t1, t2;
  if (fl <= tl && tr <= fr) {
    tmp = make_pair(l[node], r[node]);
    return tmp;
  }
  m = tl + tr >> 1;
  if (m + 1 <= fl) return query(node << 1 | 1, m + 1, tr, fl, fr);
  if (m >= fr) return query(node << 1, tl, m, fl, fr);
  t1 = query(node << 1, tl, m, fl, fr);
  t2 = query(node << 1 | 1, m + 1, tr, fl, fr);
  return bound(t1.first, t1.second, t2.first, t2.second);
}
int main() {
  int i, n, q;
  int x, y;
  int a, b;
  scanf("%d%d", &n, &q);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &a, &b);
    p[i] = (long double)(a) / (long double)(b);
  }
  build(1, 1, n);
  int pos, k;
  pair<long double, long double> tmp;
  long double d;
  for (i = 1; i <= q; i++) {
    scanf("%d", &pos);
    if (pos == 1) {
      scanf("%d%d%d", &k, &a, &b);
      d = (long double)(a) / (long double)(b);
      modify(1, 1, n, k, d);
    } else {
      scanf("%d%d", &x, &y);
      tmp = query(1, 1, n, x, y);
      d = tmp.first;
      printf("%.8lf\n", (double)d);
    }
  }
}
