#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-5;
const long double PI = acos(-1);
int mod = (int)998244353;
const int MOD7 = 1000000007;
const int MOD9 = 1000000009;
const long long INF = 8.5e18;
const int inf = 1e9;
mt19937 rnd(std::chrono::steady_clock::now().time_since_epoch().count());
int ppc(int x) {
  int ans = 0;
  for (; x; x &= (x - 1)) ++ans;
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  srand(time(NULL));
  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i].first >> a[i].second;
  long double ans = 0;
  for (int res = 1; res <= 10000; ++res) {
    for (int winner = 0; winner < n; ++winner) {
      ans;
      for (int mask = 0; mask < (1 << n); ++mask) {
        if (ppc(mask) < 2 || !((mask >> winner) & 1)) continue;
        int rofl = ppc(mask);
        long double prob = (long double)1 / rofl;
        for (int j = 0; j < n; ++j) {
          if ((mask >> j) & 1) {
            if (a[j].first > res || a[j].second < res)
              prob = 0;
            else
              prob *= (long double)1 / (a[j].second - a[j].first + 1);
          } else {
            if (a[j].first >= res)
              prob = 0;
            else {
              if (a[j].second < res)
                continue;
              else {
                prob *= (long double)(res - a[j].first) /
                        (a[j].second - a[j].first + 1);
              }
            }
          }
        }
        ans += prob * res;
      }
      for (int masksec = 1; masksec < (1 << n); ++masksec) {
        if ((masksec >> winner) & 1) continue;
        long double prob = 1;
        if (a[winner].first > res) {
        } else if (a[winner].second <= res)
          prob = 0;
        else {
          prob *= (long double)(a[winner].second - res) /
                  (a[winner].second - a[winner].first + 1);
        }
        for (int j = 0; j < n; ++j) {
          if (j == winner) continue;
          if ((masksec >> j) & 1) {
            if (res < a[j].first || res > a[j].second)
              prob = 0;
            else {
              prob *= (long double)1 / (a[j].second - a[j].first + 1);
            }
          } else {
            if (a[j].first >= res)
              prob = 0;
            else if (a[j].second < res) {
            } else {
              prob *= (long double)(res - a[j].first) /
                      (a[j].second - a[j].first + 1);
            }
          }
        }
        ans += prob * res;
      }
    }
  }
  cout << fixed << setprecision(20) << ans;
}
