#include <bits/stdc++.h>
using namespace std;
const double ONE = 1.0;
const int MAXN = 100005;
const int INF = 0X3F3F3F3F;
int N, Q;
double P[MAXN];
struct Node {
  int l, r;
  pair<double, double> val;
} s[MAXN * 8];
void Push_Up(int rt) {
  pair<double, double> ret1 = s[rt * 2].val, ret2 = s[rt * 2 + 1].val;
  s[rt].val.first =
      ret1.first * ret2.first / (1 - ret1.second * (1 - ret2.first));
  s[rt].val.second = ret2.second + (1 - ret2.second) * ret2.first *
                                       ret1.second /
                                       (1 - ret1.second * (1 - ret2.first));
}
void Build(int rt, int l, int r) {
  s[rt].l = l;
  s[rt].r = r;
  s[rt].val.first = s[rt].val.second = -INF;
  if (l == r) {
    s[rt].val.first = P[l];
    s[rt].val.second = P[l];
    return;
  }
  int mid = (l + r) / 2;
  Build(rt * 2, l, mid);
  Build(rt * 2 + 1, mid + 1, r);
  Push_Up(rt);
}
void Insert(int rt, int p, double val) {
  if (s[rt].l > p || s[rt].r < p) return;
  if (s[rt].l == s[rt].r) {
    s[rt].val.first = s[rt].val.second = val;
    return;
  }
  Insert(rt * 2, p, val);
  Insert(rt * 2 + 1, p, val);
  Push_Up(rt);
}
pair<double, double> Query(int rt, int l, int r) {
  pair<double, double> ret;
  ret.first = ret.second = -INF;
  if (s[rt].l > r || s[rt].r < l) return ret;
  if (s[rt].l >= l && s[rt].r <= r) return s[rt].val;
  pair<double, double> ret1, ret2;
  ret1 = Query(rt * 2, l, r);
  ret2 = Query(rt * 2 + 1, l, r);
  if (ret1.first == -INF && ret2.first == -INF) return ret;
  if (ret1.first == -INF)
    ret = ret2;
  else if (ret2.first == -INF)
    ret = ret1;
  else {
    ret.first = ret1.first * ret2.first / (1 - ret1.second * (1 - ret2.first));
    ret.second = ret2.second + (1 - ret2.second) * ret2.first * ret1.second /
                                   (1 - ret1.second * (1 - ret2.first));
  }
  return ret;
}
int main() {
  scanf("%d%d", &N, &Q);
  for (int i = 1, A, B; i <= N; i++) {
    scanf("%d%d", &A, &B);
    P[i] = ONE * A / B;
  }
  Build(1, 1, N);
  for (int i = 1, k, x, y, z; i <= Q; i++) {
    scanf("%d%d%d", &k, &x, &y);
    if (k == 1) {
      scanf("%d", &z);
      Insert(1, x, ONE * y / z);
    }
    if (k == 2) printf("%.10f\n", Query(1, x, y).first);
  }
  return 0;
}
