#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
string const toString(T const &x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
int const MAXV = 10000 + 1;
int const MINV = 0;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < int(n); ++i) {
    cin >> v[i].first >> v[i].second;
  }
  double mean = 0;
  for (int x = MINV; x <= MAXV; ++x) {
    for (int i = 0; i < int(n); ++i) {
      pair<int, int> const &vi = v[i];
      if (x >= vi.second) continue;
      int const y = max(x + 1, vi.first);
      double pp = (vi.second - y + 1.0) / (vi.second - vi.first + 1.0);
      int const border = (1 << n) - 1;
      for (int mask = 0; mask <= border; ++mask) {
        int cnt = 0;
        for (int j = 0; j < int(n); ++j) {
          if (j == i) continue;
          cnt += (mask & (1 << j)) != 0;
        }
        if (cnt < 1) continue;
        double p = pp;
        for (int j = 0; j < int(n); ++j) {
          if (i == j) continue;
          pair<int, int> const &vj = v[j];
          if (mask & (1 << j)) {
            if (x < vj.first || x > vj.second) p *= 0;
            p *= 1.0 / (vj.second - vj.first + 1.0);
          } else {
            if (x <= vj.first) p *= 0;
            int const y = min(x - 1, vj.second);
            p *= (y - vj.first + 1.0) / (vj.second - vj.first + 1.0);
          }
        }
        mean += x * p / 2;
      }
    }
    int const border = (1 << n) - 1;
    for (int mask = 0; mask <= border; ++mask) {
      int cnt = 0;
      for (int i = 0; i < int(n); ++i) {
        cnt += (mask & (1 << i)) != 0;
      }
      if (cnt < 2) continue;
      double p = 1.0;
      for (int i = 0; i < int(n); ++i) {
        pair<int, int> const &vi = v[i];
        if (mask & (1 << i)) {
          if (x < vi.first || x > vi.second) p *= 0;
          p *= 1.0 / (vi.second - vi.first + 1.0);
        } else {
          if (x <= vi.first) p *= 0;
          int const y = min(x - 1, vi.second);
          p *= (y - vi.first + 1.0) / (vi.second - vi.first + 1.0);
        }
      }
      mean += x * p;
    }
  }
  cout.precision(12);
  cout << fixed << mean << endl;
  return 0;
}
