#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  pair<int, int> lm[5];
  for (int i = 0; i < n; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    lm[i] = make_pair(a, b);
  }
  long double an = 0.0, p[5];
  for (int i = 0; i < 5; ++i) p[i] = 1.0l / (lm[i].second - lm[i].first + 1);
  for (int x = 1; x < 10001; ++x)
    for (int i = 0; i < n + 1; ++i) {
      if (i != n && x >= lm[i].second) continue;
      for (int j = 1; j < 1 << n; ++j) {
        long double z = x;
        if (i != n) z *= p[i] * (lm[i].second - max(x + 1, lm[i].first) + 1);
        int o = 0;
        for (int q = 0; q < n; ++q) {
          if (1 << q & j) {
            if (q == i) {
              z = 0;
              break;
            }
            if (x > lm[q].second || x < lm[q].first) {
              z = 0;
              break;
            } else
              z *= p[q];
            ++o;
          } else {
            if (q == i) continue;
            if (x <= lm[q].first) {
              z = 0;
              break;
            } else
              z *= p[q] * (min(x - 1, lm[q].second) - lm[q].first + 1);
          }
        }
        if (i == n && o == 1 || !o) continue;
        an += z;
      }
    }
  printf("%.10lf", (double)an);
}
