#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  x *= f;
}
int n, m;
double jl[100005], tree1[400005], tree2[400005];
void build(int l, int r, int rt) {
  if (l == r) {
    tree1[rt] = jl[l];
    tree2[rt] = jl[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
  tree1[rt] = tree1[rt << 1] * tree1[rt << 1 | 1];
  tree2[rt] = tree2[rt << 1] + tree2[rt << 1 | 1] * tree1[rt << 1];
}
void update(int to, double x, int l, int r, int rt) {
  if (l == r) {
    tree1[rt] = x;
    tree2[rt] = x;
    return;
  }
  int mid = (l + r) >> 1;
  if (to <= mid)
    update(to, x, l, mid, rt << 1);
  else
    update(to, x, mid + 1, r, rt << 1 | 1);
  tree1[rt] = tree1[rt << 1] * tree1[rt << 1 | 1];
  tree2[rt] = tree2[rt << 1] + 1.0 * (tree2[rt << 1 | 1]) * tree1[rt << 1];
}
double query1(int L, int R, int l, int r, int rt) {
  if (L <= l && R >= r) return tree1[rt];
  int mid = (l + r) >> 1;
  double ans = 1.0;
  if (L <= mid) ans = 1.0 * ans * query1(L, R, l, mid, rt << 1);
  if (R > mid) ans = 1.0 * ans * query1(L, R, mid + 1, r, rt << 1 | 1);
  return ans;
}
double query(int L, int R, int l, int r, int rt) {
  if (L > r || l > R) return 0;
  if (L <= l && R >= r) return tree2[rt];
  int mid = (l + r) >> 1;
  double ans = 0.0;
  if (L <= mid) ans += 1.0 * query(L, R, l, mid, rt << 1);
  if (R > mid)
    ans += 1.0 * query(L, R, mid + 1, r, rt << 1 | 1) *
           query1(L, mid, l, mid, rt << 1);
  return ans;
}
void debug(int k, int l, int r) {
  cout << tree1[k] << ' ' << tree2[k] << '\n';
  if (l == r) {
    cout << "f\n";
    return;
  }
  int mid = (l + r) >> 1;
  debug(k << 1, l, mid);
  debug(k << 1 | 1, mid + 1, r);
}
int main() {
  int a, b, c, qwq;
  read(n);
  read(m);
  for (int i = 1; i <= n; ++i) {
    read(a);
    read(b);
    jl[i] = 1.0 * (b - a) / a;
  }
  build(1, n, 1);
  while (m--) {
    read(qwq);
    if (qwq == 1) {
      read(a);
      read(b);
      read(c);
      jl[a] = 1.0 * (c - b) / b;
      update(a, jl[a], 1, n, 1);
    }
    if (qwq == 2) {
      read(a);
      read(b);
      printf("%.7lf\n", 1.0 / (query(a, b, 1, n, 1) + 1.0));
    }
  }
}
