#include <bits/stdc++.h>
using namespace std;
int L[6];
int R[6];
double cant(int a, int b, int t) {
  if (t <= a) return 0.0;
  if (t > b) return 1.0 * (b - a + 1);
  return 1.0 * (t - a);
}
double cantmay(int a, int b, int t) {
  return 1.0 * (b - a + 1) - cant(a, b, t);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> L[i] >> R[i];
  double ans = 0.0;
  for (int t = 1; t <= 10000; t++) {
    double anst = 1.0;
    for (int i = 0; i < n; i++)
      anst = anst * (cant(L[i], R[i], t)) / (R[i] - L[i] + 1);
    for (int i = 0; i < n; i++) {
      double aux = 1.0;
      for (int j = 0; j < n; j++) {
        if (i != j)
          aux = aux * (cant(L[j], R[j], t)) / (R[j] - L[j] + 1);
        else
          aux = aux * (cantmay(L[j], R[j], t)) / (R[j] - L[j] + 1);
      }
      anst += aux;
    }
    ans = ans + 1.0 - anst;
  }
  printf("%.9lf", ans);
  return 0;
}
