#include <bits/stdc++.h>
using namespace std;
int n, q;
double u[100005], Tu[4 * 100005], Su[4 * 100005];
void build(int k, int l, int r) {
  if (l == r) {
    Tu[k] = u[l];
    Su[k] = u[l];
    return;
  }
  int mid = (l + r) / 2;
  build(k * 2, l, mid);
  build(k * 2 + 1, mid + 1, r);
  Tu[k] = Tu[k * 2] * Tu[k * 2 + 1];
  Su[k] = Su[k * 2] + Tu[k * 2] * Su[k * 2 + 1];
}
void update(int k, int l, int r, int x, double u) {
  if (x < l || r < x) return;
  if (l == r) {
    Tu[k] = u;
    Su[k] = u;
    return;
  }
  int mid = (l + r) / 2;
  update(k * 2, l, mid, x, u);
  update(k * 2 + 1, mid + 1, r, x, u);
  Tu[k] = Tu[k * 2] * Tu[k * 2 + 1];
  Su[k] = Su[k * 2] + Tu[k * 2] * Su[k * 2 + 1];
}
void init() {
  int a, b;
  scanf("%d%d", &n, &q);
  for (int i = (1); i <= (n); i++) {
    scanf("%d%d", &a, &b);
    u[i] = (double)(b) / a - 1;
  }
  build(1, 1, n);
}
double getTu(int k, int l, int r, int x, int y) {
  if (y < l || r < x) return 1;
  if (x <= l && r <= y) return Tu[k];
  int mid = (l + r) / 2;
  return getTu(k * 2, l, mid, x, y) * getTu(k * 2 + 1, mid + 1, r, x, y);
}
double getSu(int k, int l, int r, int x, int y) {
  if (y < l || r < x) return 0;
  if (x <= l && r <= y) {
    if (x < l) return Su[k] * getTu(1, 1, n, x, l - 1);
    return Su[k];
  }
  int mid = (l + r) / 2;
  return getSu(k * 2, l, mid, x, y) + getSu(k * 2 + 1, mid + 1, r, x, y);
}
void process() {
  int dir, L, R, a, b, x;
  while (q--) {
    scanf("%d", &dir);
    if (dir == 2) {
      scanf("%d%d", &L, &R);
      float res = getSu(1, 1, n, L, R);
      if (res < 1E30)
        res = (1.0) / (1.0 + res);
      else
        res = 0;
      cout << res << endl;
      ;
    } else {
      scanf("%d%d%d", &x, &a, &b);
      double u = (double)(b) / a - 1;
      update(1, 1, n, x, u);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  init();
  process();
  return 0;
}
