Problem: There are n casinos lined in a row. If Memory plays at casino i, he has probability pi to win and move to the casino on the right (i + 1) or exit the row (if i = n), and a probability 1 - pi to lose and move to the casino on the left (i - 1) or also exit the row (if i = 1). 

We say that Memory dominates on the interval i... j if he completes a walk such that,

  * He starts on casino i. 
  * He never looses in casino i. 
  * He finishes his walk by winning in casino j. 



Note that Memory can still walk left of the 1-st casino and right of the casino n and that always finishes the process.

Now Memory has some requests, in one of the following forms:

  * 1 i a b: Set <image>. 
  * 2 l r: Print the probability that Memory will dominate on the interval l... r, i.e. compute the probability that Memory will first leave the segment l... r after winning at casino r, if she starts in casino l. 



It is guaranteed that at any moment of time p is a non-decreasing sequence, i.e. pi ≤ pi + 1 for all i from 1 to n - 1.

Please help Memory by answering all his requests!

Input

The first line of the input contains two integers n and q(1 ≤ n, q ≤ 100 000), — number of casinos and number of requests respectively.

The next n lines each contain integers ai and bi (1 ≤ ai < bi ≤ 109) — <image> is the probability pi of winning in casino i.

The next q lines each contain queries of one of the types specified above (1 ≤ a < b ≤ 109, 1 ≤ i ≤ n, 1 ≤ l ≤ r ≤ n).

It's guaranteed that there will be at least one query of type 2, i.e. the output will be non-empty. Additionally, it is guaranteed that p forms a non-decreasing sequence at all times.

Output

Print a real number for every request of type 2 — the probability that boy will "dominate" on that interval. Your answer will be considered correct if its absolute error does not exceed 10 - 4.

Namely: let's assume that one of your answers is a, and the corresponding answer of the jury is b. The checker program will consider your answer correct if |a - b| ≤ 10 - 4.

Example

Input

3 13
1 3
1 2
2 3
2 1 1
2 1 2
2 1 3
2 2 2
2 2 3
2 3 3
1 2 2 3
2 1 1
2 1 2
2 1 3
2 2 2
2 2 3
2 3 3


Output

0.3333333333
0.2000000000
0.1666666667
0.5000000000
0.4000000000
0.6666666667
0.3333333333
0.2500000000
0.2222222222
0.6666666667
0.5714285714
0.6666666667

Solution (in CPP):

Solution:
#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";
  }
}