#include <bits/stdc++.h>
using namespace std;
struct node {
  int l, r;
  double A, B;
} T[100010 << 2];
double num[100010];
inline void pushup(int rt) {
  T[rt].A = T[rt << 1].A * T[rt << 1 | 1].A;
  T[rt].B = T[rt << 1].B + T[rt << 1].A * T[rt << 1 | 1].B;
}
void build(int rt, int l, int r) {
  T[rt].l = l, T[rt].r = r;
  int mid = (l + r) >> 1;
  if (l == r) {
    T[rt].A = T[rt].B = num[l];
    return;
  }
  build(rt << 1, l, mid), build(rt << 1 | 1, mid + 1, r);
  pushup(rt);
}
void update(int rt, int at, double x) {
  int l = T[rt].l, r = T[rt].r, mid = (l + r) >> 1;
  if (l == r) {
    T[rt].A = T[rt].B = x;
    return;
  }
  if (at <= mid)
    update(rt << 1, at, x);
  else
    update(rt << 1 | 1, at, x);
  pushup(rt);
}
pair<double, double> query(int rt, int start, int end) {
  int l = T[rt].l, r = T[rt].r, mid = (l + r) >> 1;
  if (start <= l && r <= end) return make_pair(T[rt].A, T[rt].B);
  if (end <= mid) return query(rt << 1, start, end);
  if (start > mid) return query(rt << 1 | 1, start, end);
  pair<double, double> tmp1 = query(rt << 1, start, end),
                       tmp2 = query(rt << 1 | 1, start, end);
  return make_pair(tmp1.first * tmp2.first,
                   tmp1.second + tmp1.first * tmp2.second);
}
int main() {
  int n, q, a, b;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++)
    scanf("%d%d", &a, &b), num[i] = (double)(b - a) / a;
  build(1, 1, n);
  while (q--) {
    int op, c;
    scanf("%d%d%d", &op, &a, &b);
    if (op == 1)
      scanf("%d", &c), update(1, a, (double)(c - b) / b);
    else
      printf("%.10lf\n", 1 / (1 + query(1, a, b).second));
  }
  return 0;
}
