#include <bits/stdc++.h>
using namespace std;
const int N = 100010, kkk = N * 4 - 1;
long double ts[N * 4], st[N * 4], tss, stt;
int n, q, x, y, ff, z;
long double p[N];
void build(int ind, int be, int en) {
  if (be == en) {
    st[ind] = ts[ind] = (1 - p[be]) / p[be];
    return;
  }
  int mid = (be + en) >> 1;
  if (be <= mid) build(ind << 1, be, mid);
  if (mid + 1 <= en) build(ind << 1 | 1, mid + 1, en);
  st[ind] = ts[ind << 1] * st[ind << 1 | 1] + st[ind << 1];
  ts[ind] = ts[ind << 1] * ts[ind << 1 | 1];
}
void change(int ind, int be, int en, int x) {
  if (be == x && x == en) {
    st[ind] = ts[ind] = (1 - p[be]) / p[be];
    return;
  }
  int mid = (be + en) >> 1;
  if (x <= mid)
    change(ind << 1, be, mid, x);
  else
    change(ind << 1 | 1, mid + 1, en, x);
  st[ind] = ts[ind << 1] * st[ind << 1 | 1] + st[ind << 1];
  ts[ind] = ts[ind << 1] * ts[ind << 1 | 1];
}
void ask(int ind, int be, int en, int l, int r) {
  if (l <= be && en <= r) {
    stt += tss * st[ind];
    tss = tss * ts[ind];
    return;
  }
  int mid = (be + en) >> 1;
  if (l <= mid) ask(ind << 1, be, mid, l, r);
  if (r >= mid + 1) ask(ind << 1 | 1, mid + 1, en, l, r);
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    p[i] = 1.0 * x / y;
  }
  build(1, 1, n);
  while (q--) {
    scanf("%d", &ff);
    if (ff == 2) {
      scanf("%d%d", &x, &y);
      stt = 0;
      tss = 1;
      ask(1, 1, n, x, y);
      if (abs(stt) <= 1e15)
        printf("%.10Lf\n", 1 / (1 + stt));
      else
        printf("%.10Lf\n", 0);
    } else {
      scanf("%d%d%d", &x, &y, &z);
      p[x] = 1.0 * y / z;
      change(1, 1, n, x);
    }
  }
  return 0;
}
