#include <bits/stdc++.h>
using namespace std;
int n, l[7], r[7];
double ans;
double pr_bw(int id, int lo, int hi) {
  if (lo > hi) return 0.0;
  return (max(0, min(hi, r[id]) - max(lo, l[id]) + 1) * 1.00) /
         ((r[id] - l[id] + 1) * 1.00);
}
double pr_snd_high(int snd) {
  double pr = 0.0;
  for (int hb = -1; hb < n; hb++) {
    for (int eb = 1; eb < (1 << n); eb++) {
      if (hb >= 0 && (eb & (1 << hb))) continue;
      if (hb == -1 && __builtin_popcount(eb) < 2) continue;
      double ta = 1.0;
      if (hb >= 0) ta *= pr_bw(hb, snd + 1, r[hb]);
      for (int i = 0; i < n; i++) {
        if (i == hb) continue;
        if (eb & (1 << i))
          ta *= pr_bw(i, snd, snd);
        else
          ta *= pr_bw(i, l[i], snd - 1);
      }
      pr += ta;
    }
  }
  return pr;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d %d", &l[i], &r[i]);
  ans = 0.0;
  for (int i = 1; i <= 10000; i++) ans += i * pr_snd_high(i);
  printf("%.17lf\n", ans);
  return 0;
}
