#include <bits/stdc++.h>
using namespace std;
double dp[6][6][6];
bool vis[6][6][6];
pair<int, int> a[6];
int n;
double rec(int pos, int moreCount, int equalCount, int b) {
  if (pos == n) {
    if (moreCount == 1 && equalCount >= 1) {
      return 1.0;
    }
    if (moreCount == 0 && equalCount > 1) {
      return 1.0;
    }
    return 0.0;
  }
  if (vis[pos][moreCount][equalCount]) return dp[pos][moreCount][equalCount];
  vis[pos][moreCount][equalCount] = 1;
  dp[pos][moreCount][equalCount] = 0;
  double diff;
  if (moreCount == 0 && a[pos].second > b) {
    if (b >= a[pos].first) {
      diff = a[pos].second - b;
    } else {
      diff = a[pos].second - a[pos].first + 1;
    }
    diff /= (a[pos].second - a[pos].first + 1.0);
    dp[pos][moreCount][equalCount] =
        diff * rec(pos + 1, moreCount + 1, equalCount, b);
  }
  if (b >= a[pos].first && b <= a[pos].second) {
    diff = a[pos].second - a[pos].first + 1;
    dp[pos][moreCount][equalCount] +=
        (1.0 / diff) * rec(pos + 1, moreCount, equalCount + 1, b);
  }
  if (b > a[pos].first) {
    if (b > a[pos].second) {
      diff = a[pos].second - a[pos].first + 1;
    } else {
      diff = b - a[pos].first;
    }
    diff /= (a[pos].second - a[pos].first + 1.0);
    dp[pos][moreCount][equalCount] +=
        diff * rec(pos + 1, moreCount, equalCount, b);
  }
  return dp[pos][moreCount][equalCount];
}
int main() {
  cin >> n;
  int x = 10001, y = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
    x = min(x, a[i].first);
    y = max(y, a[i].second);
  }
  double ans = 0;
  for (int i = 1; i <= 10000; i++) {
    for (int j = 0; j < 6; j++) {
      for (int k = 0; k < 6; k++) {
        for (int l = 0; l < 6; l++) {
          dp[j][k][l] = 0;
          vis[j][k][l] = 0;
        }
      }
    }
    ans = ans + rec(0, 0, 0, i) * i;
  }
  cout << fixed << setprecision(10) << ans;
  return 0;
}
