#include <bits/stdc++.h>
using namespace std;
bool bel(int a, int b, int c) { return (a <= b && b <= c); }
long double pp(int k, int h, int bufh, int T, int l, int r) {
  if (k == h) {
    if (bufh)
      if (bel(l, T, r)) {
        return ((long double)1 / (long double)(r - l + 1));
      } else {
        return 0.0;
      }
    else if (T >= r)
      return 0.0;
    else if (T >= l - 1)
      return (long double)(r - T) / (long double)(r - l + 1);
    else
      return (long double)(1.0);
  } else {
    if (bufh)
      if (bel(l, T, r)) {
        return ((long double)1 / (long double)(r - l + 1));
      } else {
        return 0.0;
      }
    else if (T <= l)
      return 0.0;
    else if (T >= r + 1)
      return (long double)(1.0);
    else
      return (long double)(T - l) / (long double)(r - l + 1);
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> l(5, 1), r(5, 10000);
  for (int i = 0; i < n; ++i) {
    cin >> l[i] >> r[i];
  }
  vector<int> buf(10);
  long double ans = 0.0;
  for (int T = 1; T <= 10000; ++T) {
    for (int bbb = 1; bbb < (1 << n); ++bbb) {
      int bb = bbb;
      int i = n - 1;
      for (int j = 0; j < 10; ++j) {
        buf[j] = 0;
      }
      int kol = 0;
      while (bb) {
        buf[i] = bb % 2;
        kol += bb % 2;
        bb /= 2;
        --i;
      }
      for (int k = 0; k < n; ++k) {
        if (buf[k]) {
          if (buf[0] + buf[1] + buf[2] + buf[3] + buf[4] == 1)
            continue;
          else {
            long double add = 1.0;
            for (int h = 0; h < n; ++h) {
              add *= pp(k, h, buf[h], T, l[h], r[h]);
            }
            ans += T * add / kol;
          }
        } else {
          long double add = 1.0;
          for (int h = 0; h < n; ++h) {
            add *= pp(k, h, buf[h], T, l[h], r[h]);
          }
          ans += T * add;
        }
      }
    }
  }
  printf("%0.11lf", ans);
  return 0;
}
