#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int N, Q;
struct Node {
  double f, g;
} t[MAXN << 2];
Node pushup(Node t1, Node t2) {
  double &f1 = t1.f, &g1 = t1.g;
  double &f2 = t2.f, &g2 = t2.g;
  double f = f1 * f2 / (1 - (1 - f2) * g1);
  double g = g2 + (1 - g2) * g1 * f2 / (1 + (f2 - 1) * g1);
  return {f, g};
}
void update(int root, int pos, double val, int L = 1, int R = N) {
  if (L == R) return void(t[root].f = t[root].g = val);
  int mid = L + (R - L) / 2;
  if (pos <= mid)
    update(root * 2, pos, val, L, mid);
  else
    update(root * 2 + 1, pos, val, mid + 1, R);
  t[root] = pushup(t[root * 2], t[root * 2 + 1]);
}
Node query(int root, int a, int b, int L = 1, int R = N) {
  if (a == L && b == R) return t[root];
  int mid = L + (R - L) / 2;
  if (b <= mid)
    return query(root * 2, a, b, L, mid);
  else if (a > mid)
    return query(root * 2 + 1, a, b, mid + 1, R);
  else {
    return pushup(query(root * 2, a, mid, L, mid),
                  query(root * 2 + 1, mid + 1, b, mid + 1, R));
  }
}
int main() {
  scanf("%d%d", &N, &Q);
  for (int i = 1; i <= N; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    update(1, i, a * 1.0 / b);
  }
  while (Q--) {
    int op;
    scanf("%d", &op);
    if (op == 1) {
      int pos, a, b;
      scanf("%d%d%d", &pos, &a, &b);
      update(1, pos, a * 1.0 / b);
    } else {
      int a, b;
      scanf("%d%d", &a, &b);
      printf("%.10f\n", query(1, a, b).f);
    }
  }
  return 0;
}
