#include <bits/stdc++.h>
using namespace std;
double equals(int l, int r, int x) {
  if (x < l || r < x) {
    return 0;
  }
  return 1.0 / (r + 1 - l);
}
double less1(int l, int r, int x) {
  if (x <= l) {
    return 0;
  }
  if (x > r) {
    return 1;
  }
  return double(x - l) / (r + 1 - l);
}
double greater1(int l, int r, int x) {
  return 1 - equals(l, r, x) - less1(l, r, x);
}
int main() {
  vector<int> l, r;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    l.push_back(x);
    r.push_back(y);
  }
  double ans = 0;
  for (int i = 1; i <= 10001; i++) {
    double p = 0;
    for (int g = 0; g < n; g++) {
      double p1 = greater1(l[g], r[g], i);
      double allLess = 1;
      double allLessOrEquals = 1;
      for (int j = 0; j < n; j++) {
        if (j == g) {
          continue;
        }
        allLess *= less1(l[j], r[j], i);
        allLessOrEquals *= less1(l[j], r[j], i + 1);
      }
      p1 *= (allLessOrEquals - allLess);
      p += p1;
    }
    double allLess = 1;
    double allLessOrEquals = 1;
    for (int j = 0; j < n; j++) {
      allLess *= less1(l[j], r[j], i);
      allLessOrEquals *= less1(l[j], r[j], i + 1);
    }
    double only1Equals = 0;
    for (int j = 0; j < n; j++) {
      double p1 = equals(l[j], r[j], i);
      for (int z = 0; z < n; z++) {
        if (z == j) {
          continue;
        }
        p1 *= less1(l[z], r[z], i);
      }
      only1Equals += p1;
    }
    double p2 = allLessOrEquals - allLess - only1Equals;
    p += p2;
    ans += i * p;
  }
  printf("%.10lf\n", ans);
  return 0;
}
