#include <bits/stdc++.h>
using namespace std;
const int N = 20;
int n, l[N], r[N];
double ans = 0.0;
int main() {
  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 p = l[i]; p <= r[i]; p++) {
      for (int j = 0; j < n; j++) {
        if (i == j) {
          continue;
        }
        double pr = 1.0 * p / (r[i] - l[i] + 1.0);
        if (j < i) {
          pr *= 1.0 * max(0, r[j] - max(l[j], p) + 1) / (r[j] - l[j] + 1);
        } else {
          pr *= 1.0 * max(0, r[j] - max(l[j], p + 1) + 1) / (r[j] - l[j] + 1);
        }
        for (int k = 0; k < n; k++) {
          if (k == i || k == j) {
            continue;
          }
          if (k < i) {
            pr *= 1.0 * max(0, min(p - 1, r[k]) - l[k] + 1) / (r[k] - l[k] + 1);
          } else {
            pr *= 1.0 * max(0, min(p, r[k]) - l[k] + 1) / (r[k] - l[k] + 1);
          }
        }
        ans += pr;
      }
    }
  }
  printf("%.15f\n", ans);
  return 0;
}
