#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> v[6];
double dp[5][10010][2][6];
int mark[5][10010][2][6];
double solve(int curr, int maior, int ok, int ok2) {
  if (curr == n) {
    if (ok2 && ok) {
      return 1.0;
    } else if (ok2 > 1) {
      return 1.0;
    }
    return 0;
  }
  double& ret = dp[curr][maior][ok][ok2];
  if (mark[curr][maior][ok][ok2] != 0) {
    return ret;
  }
  mark[curr][maior][ok][ok2] = 1;
  ret = 0;
  int l = v[curr].first;
  int r = v[curr].second;
  if (r >= maior) {
    if (l <= maior) {
      if (!ok)
        ret = solve(curr + 1, maior, 1, ok2) * (double)(r - maior) /
              (double)(r - l + 1);
      ret += solve(curr + 1, maior, ok, ok2 + 1) * (double)(1.0) /
             (double)(r - l + 1);
      ret += solve(curr + 1, maior, ok, ok2) * (double)(maior - l) /
             (double)(r - l + 1);
    } else if (!ok) {
      ret = solve(curr + 1, maior, 1, ok2);
    }
  } else {
    ret = solve(curr + 1, maior, ok, ok2);
  }
  return ret;
}
int main(void) {
  ios ::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> v[i].first >> v[i].second;
  }
  double ret = 0;
  memset(mark, 0, sizeof mark);
  for (int i = 0; i < 10010; ++i) {
    ret += (double)i * solve(0, i, 0, 0);
  }
  cout << fixed << setprecision(10) << ret << "\n";
  return 0;
}
