#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int N = 1e5;
pair<long double, long double> Segtree[3 * N];
long double b[N + 1];
pair<long double, long double> merge(pair<long double, long double> l,
                                     pair<long double, long double> r) {
  pair<long double, long double> ret;
  long double y = r.first / (1 - (1 - r.first) * l.second);
  ret.first = l.first * y;
  ret.second = r.second + (1 - r.second) * l.second * y;
  return ret;
}
void build(int pos, int l, int r) {
  if (l == r)
    Segtree[pos].first = Segtree[pos].second = b[l];
  else {
    int mid = (l + r) / 2;
    build((pos << 1), l, mid);
    build((pos << 1) + 1, mid + 1, r);
    Segtree[pos] = merge(Segtree[(pos << 1)], Segtree[(pos << 1) + 1]);
  }
}
void update(int pos, int l, int r, long double p, int idx) {
  if (idx > r || idx < l) return;
  if (l == r)
    Segtree[pos].first = Segtree[pos].second = p;
  else {
    int mid = (l + r) / 2;
    update((pos << 1), l, mid, p, idx);
    update((pos << 1) + 1, mid + 1, r, p, idx);
    Segtree[pos] = merge(Segtree[(pos << 1)], Segtree[(pos << 1) + 1]);
  }
}
pair<long double, long double> query(int pos, int tl, int tr, int l, int r) {
  if (r < tl || l > tr) return {1, 0};
  if (l <= tl && tr <= r) {
    return Segtree[pos];
  }
  int mid = (tl + tr) / 2;
  auto lc = query((pos << 1), tl, mid, l, r);
  auto rc = query((pos << 1) + 1, mid + 1, tr, l, r);
  auto ret = merge(lc, rc);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    long double i1, i2;
    cin >> i1 >> i2;
    b[i] = i1 / i2;
  }
  build(1, 1, n);
  for (int i = 0; i < q; i++) {
    int type;
    cin >> type;
    if (type == 1) {
      int pos;
      pair<long double, long double> s;
      cin >> pos >> s.first >> s.second;
      update(1, 1, n, s.first / s.second, pos);
    } else {
      int l, r;
      cin >> l >> r;
      auto ans = query(1, 1, n, l, r);
      cout << fixed << setprecision(15) << ans.first << '\n';
    }
  }
  return 0;
}
