#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > a;
int cst;
vector<int> bmp;
long double ans = 0;
void gen(int id) {
  if ((int)bmp.size() == id) {
    long double p = 1;
    int cnt1 = 0;
    int cnt0 = 0;
    for (int i = 0; i < (int)bmp.size(); ++i) {
      if (bmp[i] == -1) {
        if (cst > a[i].first) {
          p *= (((long double)min(cst, a[i].second + 1) - a[i].first) /
                (a[i].second - a[i].first + 1));
        } else {
          p = 0;
        }
      }
      if (bmp[i] == 0) {
        if (cst >= a[i].first && cst <= a[i].second) {
          p *= (long double)1 / (a[i].second - a[i].first + 1);
        } else {
          p = 0;
        }
        ++cnt0;
      }
      if (bmp[i] == 1) {
        if (cst < a[i].second) {
          p *= (long double)(a[i].second - max(cst, a[i].first - 1)) /
               (a[i].second - a[i].first + 1);
        } else {
          p = 0;
        }
        ++cnt1;
      }
    }
    if (cnt0 + cnt1 >= 2 && cnt0 >= 1 && cnt1 <= 1) {
      ans += p * cst;
    }
    return;
  }
  bmp[id] = -1;
  gen(id + 1);
  bmp[id] = 0;
  gen(id + 1);
  bmp[id] = 1;
  gen(id + 1);
}
int main() {
  int n;
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i].first >> a[i].second;
  bmp.resize(n);
  for (int c = 1; c <= 10000; ++c) {
    cst = c;
    gen(0);
  }
  printf("%.20Lf\n", ans);
}
