#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100050;
int a[Maxn], b[Maxn], here[Maxn];
class Node {
 public:
  int l, r;
  double f, g;
  Node(int _l = 0, int _r = 0) { l = _l, r = _r; }
} v[Maxn << 2];
Node Merge(Node le, Node ri) {
  Node c = Node(le.l, ri.r);
  c.f = le.f * ri.f / (1 - (1 - ri.f) * le.g);
  c.g = ri.g + (1 - ri.g) * le.g * ri.f / (1 - le.g * (1 - ri.f));
  return c;
}
void push_up(int x) {
  if (x == 0) return;
  int fa = x >> 1;
  if (x & 1) x ^= 1;
  v[fa] = Merge(v[x], v[x ^ 1]);
  push_up(fa);
}
void build(int l, int r, int node) {
  v[node].l = l, v[node].r = r;
  if (l == r) {
    here[l] = node;
    v[node].f = (double)a[l] / b[l], v[node].g = v[node].f;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, node + node);
  build(mid + 1, r, node + node + 1);
  v[node] = Merge(v[node << 1], v[(node << 1) | 1]);
}
Node ask(int l, int r, int node) {
  if (v[node].l >= l && v[node].r <= r) return v[node];
  Node tmp1, tmp2;
  int flag1 = 0, flag2 = 0, mid = (v[node].l + v[node].r) >> 1;
  if (mid >= l) tmp1 = ask(l, r, node << 1), flag1++;
  if (mid < r) tmp2 = ask(l, r, (node << 1) | 1), flag2++;
  if (flag1 && flag2)
    return Merge(tmp1, tmp2);
  else
    return flag1 ? tmp1 : tmp2;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; ++i) scanf("%d%d", &a[i], &b[i]);
  build(1, n, 1);
  while (q--) {
    int op, l, r;
    scanf("%d%d%d", &op, &l, &r);
    if (op == 1) {
      int t;
      scanf("%d", &t);
      v[here[l]].f = v[here[l]].g = (double)r / t;
      push_up(here[l]);
    } else {
      Node ans = ask(l, r, 1);
      printf("%.10lf\n", ans.f);
    }
  }
}
