#include <bits/stdc++.h>
using namespace std;
double DP[6][3][2];
int N;
double res[10003];
double find(int pos, int equal, int greater, vector<pair<int, int> >& vt,
            int b) {
  if (pos == N) {
    if ((greater > 0 && equal == 1) || equal > 1)
      return 1;
    else
      return 0;
  }
  if (DP[pos][equal][greater] != -1) return DP[pos][equal][greater];
  DP[pos][equal][greater] = 0;
  double SZ = vt[pos].second - vt[pos].first + 1;
  double num = 0;
  if (greater < 1) {
    if (vt[pos].second >= b)
      num = min(vt[pos].second - vt[pos].first + 1, vt[pos].second - b);
    DP[pos][equal][greater] +=
        num * find(pos + 1, equal, greater + 1, vt, b) / SZ;
  }
  if (vt[pos].first <= b && vt[pos].second >= b)
    DP[pos][equal][greater] +=
        find(pos + 1, min(2, equal + 1), greater, vt, b) / SZ;
  num = 0;
  if (vt[pos].first <= b)
    num = min(vt[pos].second - vt[pos].first + 1, b - vt[pos].first);
  DP[pos][equal][greater] += num * find(pos + 1, equal, greater, vt, b) / SZ;
  return DP[pos][equal][greater];
}
void init() {
  for (int i = 0; i < N; i++) {
    DP[i][0][0] = -1;
    DP[i][1][0] = -1;
    DP[i][2][0] = -1;
    DP[i][0][1] = -1;
    DP[i][1][1] = -1;
    DP[i][2][1] = -1;
  }
}
int main() {
  cin >> N;
  vector<pair<int, int> > vt;
  int minL = 10002, maxR = -1;
  int i = 0;
  while (i < N) {
    int L, R;
    cin >> L >> R;
    vt.push_back(pair<int, int>(L, R));
    minL = min(minL, L);
    maxR = max(maxR, R);
    i++;
  }
  double ret = 0;
  for (int j = minL; j <= maxR; j++) {
    init();
    double val = find(0, 0, 0, vt, j);
    ret += (double)j * val;
  }
  printf("%.12f\n", ret);
  return 0;
}
