#include <bits/stdc++.h>
using namespace std;
vector<double> a;
int n;
int L[10], R[10];
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &L[i], &R[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (j == i) continue;
      for (int r = L[j]; r <= R[j]; r++) {
        double v = 1.0;
        for (int k = 0; k < n; k++) {
          if (k == i) {
            if (R[k] >= r)
              v = v * (R[k] - max(L[k] - 1, r - (i < j))) / (R[k] - L[k] + 1);
            else
              v = 0;
          } else if (k == j) {
            v = v * r / (R[k] - L[k] + 1);
          } else {
            if (L[k] <= r) {
              v = v * (min(R[k], r - (k < j)) - L[k] + 1) / (R[k] - L[k] + 1);
            } else
              v = 0;
          }
        }
        a.push_back(v);
      }
    }
  sort(a.begin(), a.end());
  double ans = 0;
  for (int i = 0; i < ((int)(a).size()); i++) ans += a[i];
  printf("%.9f\n", ans);
  return 0;
}
