#include <bits/stdc++.h>
using namespace std;
double val[10];
int N;
int L[10], R[10];
double calc(int x) {
  double ans = 0;
  for (int i = 1; i < (1 << N); i++) {
    if (__builtin_popcount(i) == 1) continue;
    double p = 1;
    for (int j = 0; j < N; j++) {
      if (i & (1 << j)) {
        if (x > R[j]) {
          p = 0;
          break;
        } else {
          p *= (double)(R[j] - max(x, L[j]) + 1) / (R[j] - L[j] + 1);
        }
      } else {
        if (x < L[j]) {
          p = 0;
          break;
        } else {
          p *= (double)(min(R[j], x - 1) + 1 - L[j]) / (R[j] - L[j] + 1);
        }
      }
    }
    ans += p;
  }
  return ans;
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d%d", &L[i], &R[i]);
  double ans = 0;
  for (int i = 1; i <= 10000; i++) ans += calc(i);
  printf("%.15lf\n", ans);
  return 0;
}
