#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long MOD = 1000000007;
long double EPS = 1e-9;
long long binpow(long long b, long long p, long long mod) {
  long long ans = 1;
  b %= mod;
  for (; p; p >>= 1) {
    if (p & 1) ans = ans * b % mod;
    b = b * b % mod;
  }
  return ans;
}
void pre() {}
long double base[100100];
template <class node>
struct SegT {
  int n;
  node* t;
  SegT(int n) : n(n) { t = new node[4 * n + 10]; }
  inline node combine(node a, node b) {
    node ans;
    ans.first = a.first * b.first / (1 + a.second * (b.first - 1));
    ans.second = b.second + (a.second * b.first * (1 - b.second)) /
                                (1 - a.second * (1 - b.first));
    return ans;
  }
  void build(int id, int l, int r) {
    if (l == r) {
      t[id] = make_pair(base[l], base[l]);
      return;
    }
    build(id << 1, l, ((l + r) >> 1));
    build(id << 1 | 1, ((l + r) >> 1) + 1, r);
    t[id] = combine(t[id << 1], t[id << 1 | 1]);
  }
  void update(int id, int l, int r, int pos, long double val) {
    if (pos < l || pos > r) return;
    if (l == r) {
      t[id] = make_pair(val, val);
      return;
    }
    update(id << 1, l, ((l + r) >> 1), pos, val);
    update(id << 1 | 1, ((l + r) >> 1) + 1, r, pos, val);
    t[id] = combine(t[id << 1], t[id << 1 | 1]);
  }
  node query(int id, int l, int r, int lq, int rq) {
    if (lq <= l && r <= rq)
      return t[id];
    else if (rq <= ((l + r) >> 1)) {
      return query(id << 1, l, ((l + r) >> 1), lq, rq);
    } else if (lq > ((l + r) >> 1)) {
      return query(id << 1 | 1, ((l + r) >> 1) + 1, r, lq, rq);
    } else {
      return combine(query(id << 1, l, ((l + r) >> 1), lq, rq),
                     query(id << 1 | 1, ((l + r) >> 1) + 1, r, lq, rq));
    }
  }
};
void solve() {
  long long n, q;
  cin >> n >> q;
  for (long long i = 0; i < (n); ++i) {
    long long a, b;
    cin >> a >> b;
    base[i] = (1.0 * a) / b;
  }
  SegT<pair<long double, long double>> st(n);
  st.build(1, 0, n - 1);
  for (long long i = 0; i < (q); ++i) {
    int ch;
    cin >> ch;
    if (ch == 1) {
      long long pos, a, b;
      cin >> pos >> a >> b;
      pos--;
      base[pos] = (1.0 * a) / b;
      st.update(1, 0, n - 1, pos, base[pos]);
    } else {
      long long l, r;
      cin >> l >> r;
      l--;
      r--;
      cout << (st.query(1, 0, n - 1, l, r)).first << '\n';
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(21);
  pre();
  long long _t = 1;
  for (long long i = 1; i <= _t; i++) {
    solve();
  }
}
