#include <bits/stdc++.h>
using namespace std;
typedef struct NODE {
  long long a, b, la, lb;
  double ans, lans;
} NODE;
NODE operator+(NODE &a, NODE &b) {
  NODE c;
  c.a = a.a;
  c.b = a.b;
  c.la = b.la;
  c.lb = b.lb;
  double r = b.ans / (1 - (1 - b.ans) * a.lans);
  c.ans = a.ans * b.ans * (1 / (1 - a.lans * (1 - b.ans)));
  c.lans = b.lans + (1 - b.lans) * a.lans * r;
  return c;
}
long long n, q;
pair<long long, long long> pr[100005];
NODE tr[4 * 100005 + 555];
void build(long long, long long, long long),
    upd(long long, long long, long long, long long);
NODE query(long long, long long, long long, long long, long long);
int main() {
  scanf("%lld %lld", &n, &q);
  for (int i = 1; i < n + 1; i++)
    scanf("%lld %lld", &pr[i].first, &pr[i].second);
  build(0, 1, n);
  long long t, x, a, b;
  for (int i = 0; i < q; i++) {
    cin >> t;
    if (t == 1) {
      cin >> x >> a >> b;
      pr[x].first = a, pr[x].second = b;
      upd(0, 1, n, x);
    } else {
      cin >> a >> b;
      printf("%0.12lf\n", query(0, 1, n, a, b).ans);
    }
  }
}
void build(long long idx, long long l, long long r) {
  if (l == r) {
    tr[idx].a = pr[l].first;
    tr[idx].b = pr[l].second;
    tr[idx].la = pr[l].first;
    tr[idx].lb = pr[l].second;
    tr[idx].ans = tr[idx].lans = (pr[l].first / (pr[l].second + 0.0));
    return;
  }
  long long mid = (l + r) / 2;
  build(2 * idx + 1, l, mid);
  build(2 * idx + 2, mid + 1, r);
  tr[idx] = (tr[2 * idx + 1] + tr[2 * idx + 2]);
}
void upd(long long idx, long long l, long long r, long long pos) {
  if (r < pos || pos < l) return;
  if (l == r) {
    tr[idx].a = pr[l].first;
    tr[idx].b = pr[l].second;
    tr[idx].la = pr[l].first;
    tr[idx].lb = pr[l].second;
    tr[idx].ans = tr[idx].lans = (pr[l].first / (pr[l].second + 0.0));
    return;
  }
  long long mid = (l + r) / 2;
  upd(2 * idx + 1, l, mid, pos);
  upd(2 * idx + 2, mid + 1, r, pos);
  tr[idx] = tr[2 * idx + 1] + tr[2 * idx + 2];
}
NODE query(long long idx, long long l, long long r, long long low,
           long long high) {
  if (low <= l && r <= high) return tr[idx];
  long long mid = (l + r) / 2;
  if (high <= mid)
    return query(2 * idx + 1, l, mid, low, high);
  else if (mid + 1 <= low)
    return query(2 * idx + 2, mid + 1, r, low, high);
  NODE a = query(2 * idx + 1, l, mid, low, high);
  NODE b = query(2 * idx + 2, mid + 1, r, low, high);
  return (a + b);
}
