#include <bits/stdc++.h>
using namespace std;
using M = array<array<double, 2>, 2>;
M identity() {
  M res;
  res[0][0] = res[1][1] = 1;
  res[0][1] = res[1][0] = 0;
  return res;
}
void normalize(M& m) {
  double mx = m[0][0];
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 2; ++j) {
      mx = max(mx, std::abs(m[i][j]));
    }
  }
  if (mx > 1e9) {
    for (int i = 0; i < 2; ++i) {
      for (int j = 0; j < 2; ++j) {
        m[i][j] /= mx;
      }
    }
  }
}
M mul(const M& a, const M& b) {
  M res;
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 2; ++j) {
      res[i][j] = 0;
      for (int k = 0; k < 2; ++k) {
        res[i][j] += a[i][k] * b[k][j];
      }
    }
  }
  normalize(res);
  return res;
}
M casmat(pair<double, double> v) {
  M res;
  res[0][0] = res[1][0] = 1;
  res[0][1] = 0;
  res[1][1] = v.second / v.first - 1;
  return res;
}
double mulvec(const M& a, pair<double, double> v) {
  double up = a[0][0] * v.first + a[0][1] * v.second;
  double down = a[1][0] * v.first + a[1][1] * v.second;
  return up / down;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  vector<pair<double, double>> cas;
  for (int i = 0; i < n; ++i) {
    double a, b;
    cin >> a >> b;
    cas.emplace_back(a, b);
  }
  int sq = int(ceil(pow((double)n, 0.5)));
  vector<M> dec(sq, identity());
  for (int i = 0; i < n; ++i) {
    int part = i / sq;
    dec[part] = mul(dec[part], casmat(cas[i]));
  }
  for (int i = 0; i < q; ++i) {
    int t;
    cin >> t;
    if (t == 1) {
      int pos;
      double a, b;
      cin >> pos >> a >> b;
      pos -= 1;
      cas[pos] = {a, b};
      int part = pos / sq;
      M newshit = identity();
      for (int p = part * sq; p < min(n, part * sq + sq); ++p) {
        newshit = mul(newshit, casmat(cas[p]));
      }
      dec[part] = newshit;
    } else if (t == 2) {
      int l, r;
      cin >> l >> r;
      l--;
      r--;
      auto& last = cas[r];
      M m = identity();
      for (int p = l; p < r;) {
        if (p % sq == 0 && p + sq <= r) {
          m = mul(m, dec[p / sq]);
          p += sq;
        } else {
          m = mul(m, casmat(cas[p]));
          ++p;
        }
      }
      cout << setprecision(18) << mulvec(m, last) << '\n';
    } else
      throw "fug";
  }
}
