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;
template <typename T1, typename T2>
inline T1 max(T1 a, T2 b) {
  return a < b ? b : a;
}
template <typename T1, typename T2>
inline T1 min(T1 a, T2 b) {
  return a < b ? a : b;
}
const char lf = '\n';
namespace ae86 {
const int bufl = 1 << 15;
char buf[bufl], *s = buf, *t = buf;
inline int fetch() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, bufl, stdin);
    if (s == t) return EOF;
  }
  return *s++;
}
inline int ty() {
  int a = 0;
  int b = 1, c = fetch();
  while (!isdigit(c)) b ^= c == '-', c = fetch();
  while (isdigit(c)) a = a * 10 + c - 48, c = fetch();
  return b ? a : -a;
}
}  // namespace ae86
using ae86::ty;
const int _ = 100007;
struct cxk {
  double l, r;
  cxk(double l_ = 0, double r_ = 0) { l = l_, r = r_; }
  inline friend cxk operator*(cxk a, cxk b) {
    return cxk(b.l * a.l * (1.00 / (1.00 - (1.00 - a.l) * (1.00 - b.r))),
               a.r * b.r * (1.00 / (1.00 - (1.00 - b.r) * (1.00 - a.l))));
  }
};
struct sgt {
  static const int _t = _ << 2;
  cxk t[_t];
  inline void up(int x) { t[x] = t[(x << 1)] * t[(x << 1 | 1)]; }
  void plant(int x, int l, int r, double bas[]) {
    if (l == r) {
      t[x] = cxk(1 - bas[l], bas[l]);
      return;
    }
    plant((x << 1), l, ((l + r) >> 1), bas),
        plant((x << 1 | 1), ((l + r) >> 1) + 1, r, bas), up(x);
  }
  void change(int x, int l, int r, int tar, double dlt) {
    if (l == r) {
      t[x] = cxk(1 - dlt, dlt);
      return;
    }
    if (tar <= ((l + r) >> 1))
      change((x << 1), l, ((l + r) >> 1), tar, dlt);
    else
      change((x << 1 | 1), ((l + r) >> 1) + 1, r, tar, dlt);
    up(x);
  }
  cxk finder(int x, int l, int r, int tl, int tr) {
    if (tl <= l && r <= tr) return t[x];
    if (tr <= ((l + r) >> 1))
      return finder((x << 1), l, ((l + r) >> 1), tl, tr);
    if (tl > ((l + r) >> 1))
      return finder((x << 1 | 1), ((l + r) >> 1) + 1, r, tl, tr);
    return finder((x << 1), l, ((l + r) >> 1), tl, tr) *
           finder((x << 1 | 1), ((l + r) >> 1) + 1, r, tl, tr);
  }
} t;
int n;
double gai[_];
int main() {
  ios::sync_with_stdio(0), cout.tie(nullptr);
  n = ty();
  int qn = ty();
  for (int i = 1, a, b; i <= n; i++) a = ty(), b = ty(), gai[i] = 1.00 * a / b;
  t.plant(1, 1, n, gai);
  for (int qq = 1; qq <= qn; qq++) {
    int op = ty();
    if (op == 1) {
      int a = ty(), b = ty(), c = ty();
      t.change(1, 1, n, a, 1.00 * b / c);
    } else {
      int a = ty(), b = ty();
      cout << setprecision(12) << fixed << t.finder(1, 1, n, a, b).r << lf;
    }
  }
  return 0;
}