#include <bits/stdc++.h>
using namespace std;
inline int read() {
  register int x = 0, f = 1;
  register char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + (ch ^ '0');
    ch = getchar();
  }
  return f ? x : -x;
}
const int N = 1e5 + 10;
int n, q;
double p[N], tr[N << 2][2];
inline void pushup(int p) {
  tr[p][0] = tr[p << 1][0] * tr[p << 1 | 1][0];
  tr[p][1] = tr[p << 1][1] + tr[p << 1][0] * tr[p << 1 | 1][1];
}
inline void Build(int _p, int l, int r) {
  if (l == r) {
    tr[_p][0] = tr[_p][1] = p[l];
    return;
  }
  int mid = (l + r) >> 1;
  Build(_p << 1, l, mid), Build(_p << 1 | 1, mid + 1, r);
  pushup(_p);
}
inline pair<double, double> Query(int p, int l, int r, int L, int R) {
  if (L <= l && r <= R) return make_pair(tr[p][0], tr[p][1]);
  int mid = (l + r) >> 1;
  if (L <= mid && mid < R) {
    pair<double, double> A = Query(p << 1, l, mid, L, R),
                         B = Query(p << 1 | 1, mid + 1, r, L, R), ans;
    ans.first = A.first * B.first;
    ans.second = A.second + A.first * B.second;
    return ans;
  }
  if (L <= mid) return Query(p << 1, l, mid, L, R);
  return Query(p << 1 | 1, mid + 1, r, L, R);
}
inline void Change(int p, int l, int r, int pos, double v) {
  if (l == r) {
    tr[p][0] = tr[p][1] = v;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    Change(p << 1, l, mid, pos, v);
  else
    Change(p << 1 | 1, mid + 1, r, pos, v);
  pushup(p);
}
int main() {
  n = read(), q = read();
  for (int i = (1), ed = (n); i <= ed; ++i)
    p[i] = 1.0 * read() / read(), p[i] = (1 - p[i]) / p[i];
  Build(1, 1, n);
  while (q--) {
    int op = read();
    if (op == 1) {
      int x = read();
      p[x] = 1.0 * read() / read(), p[x] = (1 - p[x]) / p[x];
      Change(1, 1, n, x, p[x]);
    } else {
      int l = read(), r = read();
      double res = Query(1, 1, n, l, r).second;
      printf("%.8f\n", 1.0 / (res + 1));
    }
  }
  return 0;
}
