#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n;
int L[11], R[11];
double getGreater(int x, int ind) {
  int len = R[ind] - L[ind] + 1;
  if (!(L[ind] <= x && x <= R[ind])) {
    if (x < L[ind]) return 1.0;
    return 0.0;
  }
  int good = R[ind] - x;
  return good * 1.0 / len;
}
double getEqual(int x, int ind) {
  int len = R[ind] - L[ind] + 1;
  if (!(L[ind] <= x && x <= R[ind])) return 0.0;
  return 1.0 / len;
}
double getLess(int x, int ind) {
  int len = R[ind] - L[ind] + 1;
  if (!(L[ind] <= x && x <= R[ind])) {
    if (x > R[ind]) return 1.0;
    return 0.0;
  }
  int good = x - L[ind];
  return good * 1.0 / len;
}
double calc(int x) {
  double res = 0.0;
  for (int mask = 0; mask < (1 << n); mask++) {
    if (__builtin_popcount(mask) < 2) continue;
    double cur = 1.0;
    for (int i = 0; i < n; i++) {
      if (mask & (1 << i)) {
        cur *= getEqual(x, i);
      } else {
        cur *= getLess(x, i);
      }
    }
    res += cur;
  }
  for (int i = 0; i < n; i++) {
    vector<int> v;
    for (int j = 0; j < n; j++)
      if (j != i) v.push_back(j);
    for (int mask = 1; mask < (1 << (n - 1)); mask++) {
      double cur = getGreater(x, i);
      for (int j = 0; j < n - 1; j++) {
        if (mask & (1 << j)) {
          cur *= getEqual(x, v[j]);
        } else {
          cur *= getLess(x, v[j]);
        }
      }
      res += cur;
    }
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &L[i], &R[i]);
  }
  double ans = 0.0;
  for (int i = 1; i <= 10000; i++) {
    ans += i * calc(i);
  }
  printf("%.10f", ans);
  return 0;
}
