#include <bits/stdc++.h>
using namespace std;
int b_c(int x) {
  int cnt = 0;
  while (x > 0) {
    if (x % 2) cnt++;
    x /= 2;
  }
  return cnt;
}
int main() {
  int n;
  cin >> n;
  int mi = 1e9;
  int ma = 0;
  vector<pair<int, int> > arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first >> arr[i].second;
    mi = min(mi, arr[i].first);
    ma = max(ma, arr[i].second);
  }
  double ans = 0;
  for (int pr = mi; pr <= ma; pr++) {
    for (int mask = 0; mask < (1 << n); mask++) {
      int b = b_c(mask);
      if (b == 0) continue;
      if (b != 1) {
        double p = 1;
        for (int i = 0; i < n; i++) {
          if (mask & (1 << i)) {
            if (arr[i].first > pr || arr[i].second < pr) p = 0;
            p *= 1.0 / (arr[i].second - arr[i].first + 1);
          } else {
            if (arr[i].first >= pr) p = 0;
            if (arr[i].second >= pr)
              p *= double(pr - arr[i].first) /
                   (arr[i].second - arr[i].first + 1);
          }
        }
        ans += p * pr;
      }
      for (int w = 0; w < n; w++) {
        double p = 1;
        for (int i = 0; i < n; i++) {
          if (mask & (1 << i)) {
            if (i == w) p = 0;
            if (arr[i].first > pr || arr[i].second < pr) p = 0;
            p *= 1.0 / (arr[i].second - arr[i].first + 1);
          } else {
            if (i != w) {
              if (arr[i].first >= pr) p = 0;
              if (arr[i].second >= pr)
                p *= double(pr - arr[i].first) /
                     (arr[i].second - arr[i].first + 1);
            } else {
              if (arr[i].second <= pr) p = 0;
              if (arr[i].first <= pr)
                p *= double(arr[i].second - pr) /
                     (arr[i].second - arr[i].first + 1);
            }
          }
        }
        ans += p * pr;
      }
    }
  }
  printf("%.12lf\n", ans);
  return 0;
}
