#include <bits/stdc++.h>
using namespace std;
long long n;
vector<pair<long long, long long>> bids;
long double func(long long val) {
  long double dp[7][2][3];
  memset(dp, 0, sizeof(dp));
  dp[0][0][0] = 1;
  for (int i = 0; i < n; i++) {
    long double pr = 1 / (long double)(bids[i].second - bids[i].first + 1);
    long double pmore;
    if (bids[i].second < val)
      pmore = 0;
    else
      pmore = (long double)(bids[i].second - max(bids[i].first - 1, val)) * pr;
    long double pequal;
    if (val > bids[i].second || val < bids[i].first)
      pequal = 0;
    else {
      pequal = pr;
    }
    long double pless = 1 - pequal - pmore;
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 3; k++) {
        if (j == 0) dp[i + 1][1][k] += dp[i][0][k] * pmore;
        dp[i + 1][j][k] += dp[i][j][k] * pless;
        dp[i + 1][j][min(k + 1, 2)] += dp[i][j][k] * pequal;
      }
  }
  return dp[n][1][2] + dp[n][0][2] + dp[n][1][1];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  bids.resize(n);
  for (int i = 0; i < n; i++) cin >> bids[i].first >> bids[i].second;
  long double ans = 0;
  for (int val = 1; val < 10001; val++) {
    ans += val * func(val);
  }
  cout << fixed << setprecision(15) << ans;
  return 0;
}
