#include <bits/stdc++.h>
using namespace std;
const int NMAX = 100005;
int n, query;
double U[NMAX], A[4 * NMAX], B[4 * NMAX];
void creatTree(int k, int l, int r) {
  if (l == r) {
    A[k] = U[l];
    B[k] = U[l];
    return;
  }
  int mid = (l + r) / 2;
  creatTree(k * 2, l, mid);
  creatTree(k * 2 + 1, mid + 1, r);
  A[k] = A[k * 2] * A[k * 2 + 1];
  B[k] = B[k * 2] + A[k * 2] * B[k * 2 + 1];
}
void update(int k, int l, int r, int x, double u) {
  if (x < l || r < x) return;
  if (l == r) {
    A[k] = u;
    B[k] = u;
    return;
  }
  int mid = (l + r) / 2;
  update(k * 2, l, mid, x, u);
  update(k * 2 + 1, mid + 1, r, x, u);
  A[k] = A[k * 2] * A[k * 2 + 1];
  B[k] = B[k * 2] + A[k * 2] * B[k * 2 + 1];
}
double getA(int k, int l, int r, int x, int y) {
  if (y < l || r < x) return 1;
  if (x <= l && r <= y) return A[k];
  int mid = (l + r) / 2;
  return getA(k * 2, l, mid, x, y) * getA(k * 2 + 1, mid + 1, r, x, y);
}
double getB(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 B[k] * getA(1, 1, n, x, l - 1);
    return B[k];
  }
  int mid = (l + r) / 2;
  return getB(k * 2, l, mid, x, y) + getB(k * 2 + 1, mid + 1, r, x, y);
}
void init() {
  int a, b;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a, &b);
    U[i] = (double)(b) / a - 1;
  }
  creatTree(1, 1, n);
}
int main() {
  scanf("%d%d", &n, &query);
  init();
  while (query--) {
    int key;
    scanf("%d", &key);
    if (key == 2) {
      int l, r;
      scanf("%d%d", &l, &r);
      float res = getB(1, 1, n, l, r);
      if (res < 1E30)
        res = (1.0) / (1.0 + res);
      else
        res = 0;
      cout << res << "\n";
    } else {
      int a, b, x;
      scanf("%d%d%d", &x, &a, &b);
      double u = (double)(b) / a - 1;
      update(1, 1, n, x, u);
    }
  }
  return 0;
}
