#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, q;
pair<long double, long double> seg[4 * N];
pair<long double, long double> merge(pair<long double, long double> p,
                                     pair<long double, long double> q) {
  if (p.first == -1) return q;
  if (q.first == -1) return p;
  long double Fi = (p.first * q.first) / (1.0 - p.second * (1.0 - q.first));
  long double Se = q.second + (p.second * q.first * (1.0 - q.second)) /
                                  (1 - p.second * (1.0 - q.first));
  return {Fi, Se};
}
void upd(int p, long double x, int id = 1, int s = 0, int e = n) {
  if (e - s < 2) {
    seg[id] = {x, x};
    return;
  }
  int mid = (s + e) / 2;
  if (p < mid)
    upd(p, x, 2 * id, s, mid);
  else
    upd(p, x, 2 * id + 1, mid, e);
  seg[id] = merge(seg[2 * id], seg[2 * id + 1]);
}
pair<long double, long double> get(int L, int R, int id = 1, int s = 0,
                                   int e = n) {
  if (L <= s && e <= R) return seg[id];
  if (L >= e || s >= R) return {-1, -1};
  int mid = (s + e) / 2;
  return merge(get(L, R, 2 * id, s, mid), get(L, R, 2 * id + 1, mid, e));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int s, m;
    cin >> s >> m;
    upd(i, (long double)(s) / (long double)(m));
  }
  cout << fixed << setprecision(10);
  for (int i = 0; i < q; i++) {
    int tp;
    cin >> tp;
    if (tp == 1) {
      int p, s, m;
      cin >> p >> s >> m;
      --p;
      upd(p, (long double)(s) / (long double)(m));
    } else {
      int l, r;
      cin >> l >> r;
      --l;
      cout << get(l, r).first << '\n';
    }
  }
}
