#include <bits/stdc++.h>
using namespace std;
class C_ {};
template <typename T>
C_& operator<<(C_& __m, const T& __s) {
  if (!1) cerr << "\E[91m" << __s << "\E[0m";
  return __m;
}
C_ merr;
struct __s {
  __s() {
    if (1) {
      ios_base::Init i;
      cin.sync_with_stdio(0);
      cin.tie(0);
    }
  }
  ~__s() {
    merr << "Execution time: " << (double)clock() / CLOCKS_PER_SEC << " s.\n";
  }
} __S;
int L[11];
int R[11];
int cnt[11];
int main() {
  int n;
  long double ans = 0.0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> L[i] >> R[i];
    cnt[i] = R[i] - L[i] + 1;
  }
  for (int winner_bit = 1; winner_bit < (1 << n); winner_bit++) {
    vector<int> winners, losers;
    for (int i = 0; i < n; i++) {
      if (winner_bit & (1 << i)) {
        winners.push_back(i);
      } else {
        losers.push_back(i);
      }
    }
    if (winners.size() == 1) {
      int winner = winners[0];
      for (int pay = 1; pay <= R[winner] - 1; pay++) {
        for (int bit = 1; bit < (1 << losers.size()); bit++) {
          long double p = 1.0;
          for (int i = 0; i < (int)losers.size(); i++) {
            int loser = losers[i];
            if (bit & (1 << i)) {
              if (L[loser] <= pay && pay <= R[loser]) {
                p *= 1.0L / cnt[loser];
              } else {
                p = 0.0;
                break;
              }
            } else {
              if (L[loser] >= pay) {
                p = 0.0;
                break;
              } else {
                p *=
                    (min(R[loser], pay - 1) - L[loser] + 1) * 1.0L / cnt[loser];
              }
            }
          }
          ans += p * pay * (R[winner] - max(L[winner], pay + 1) + 1) * 1.0L /
                 cnt[winner];
        }
      }
    } else {
      for (int pay = 1; pay <= 10000; pay++) {
        long double p = 1.0;
        for (int i = 0; i < (int)winners.size(); i++) {
          int winner = winners[i];
          if (L[winner] <= pay && pay <= R[winner]) {
            p *= 1.0L / cnt[winner];
          } else {
            p = 0.0;
            break;
          }
        }
        for (int i = 0; i < (int)losers.size(); i++) {
          int loser = losers[i];
          if (L[loser] >= pay) {
            p = 0.0;
            break;
          } else {
            p *= (min(pay - 1, R[loser]) - L[loser] + 1) * 1.0L / cnt[loser];
          }
        }
        ans += p * pay;
      }
    }
    merr << ans << '\n';
  }
  cout << fixed << setprecision(15) << ans << '\n';
  return 0;
}
