#include <bits/stdc++.h>
using namespace std;
double a[100005], b[100005];
double t[400005][2];
void build(long long v, long long l, long long r) {
  if (l == r) {
    t[v][0] = a[l];
    t[v][0] /= b[l];
    t[v][1] = t[v][0];
    return;
  }
  long long m = (l + r) / 2;
  build(2 * v, l, m);
  build(2 * v + 1, m + 1, r);
  double l1 = t[2 * v][0];
  double l2 = t[2 * v + 1][0];
  double r1 = t[2 * v][1];
  double r2 = t[2 * v + 1][1];
  t[v][0] = l1 * l2;
  t[v][0] /= (1.0 - (1.0 - l2) * r1);
  t[v][1] = r2 + (r1 * l2 * (1.0 - r2)) / (1.0 - (1.0 - l2) * r1);
  return;
}
pair<double, double> get(long long v, long long l, long long r, long long ll,
                         long long rr) {
  if (l == ll && r == rr) {
    return {t[v][0], t[v][1]};
  }
  long long m = (l + r) / 2;
  if (rr <= m)
    return get(2 * v, l, m, ll, rr);
  else if (ll > m)
    return get(2 * v + 1, m + 1, r, ll, rr);
  else {
    pair<double, double> p1 = get(2 * v, l, m, ll, m);
    pair<double, double> p2 = get(2 * v + 1, m + 1, r, m + 1, rr);
    double l1 = p1.first;
    double l2 = p2.first;
    double r1 = p1.second;
    double r2 = p2.second;
    p1.first = l1 * l2;
    p1.first /= (1.0 - (1.0 - l2) * r1);
    p1.second = r2 + (r1 * l2 * (1.0 - r2)) / (1.0 - (1.0 - l2) * r1);
    return p1;
  }
}
void update(long long v, long long l, long long r, long long p, double x) {
  if (l == r) {
    t[v][0] = x;
    t[v][1] = x;
    return;
  }
  long long m = (l + r) / 2;
  if (p <= m)
    update(2 * v, l, m, p, x);
  else
    update(2 * v + 1, m + 1, r, p, x);
  double l1 = t[2 * v][0];
  double l2 = t[2 * v + 1][0];
  double r1 = t[2 * v][1];
  double r2 = t[2 * v + 1][1];
  t[v][0] = l1 * l2;
  t[v][0] /= (1.0 - (1.0 - l2) * r1);
  t[v][1] = r2 + (r1 * l2 * (1.0 - r2)) / (1.0 - (1.0 - l2) * r1);
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, q;
  cin >> n >> q;
  for (long long i = 0; i < n; i++) cin >> a[i] >> b[i];
  build(1, 0, n - 1);
  long long x, y, z;
  for (long long i = 0; i < q; i++) {
    cin >> x;
    if (x == 1) {
      cin >> x >> y >> z;
      update(1, 0, n - 1, x - 1, (1.0 * y) / z);
    } else {
      cin >> x >> y;
      cout << setprecision(10) << get(1, 0, n - 1, x - 1, y - 1).first << "\n";
    }
  }
  return 0;
}
