#include <bits/stdc++.h>
using namespace std;
int n;
int l[7], r[7];
double ans;
void ini() {
  ans = 0;
  int i;
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &l[i], &r[i]);
  }
}
void solve() {
  int i, j, k, v;
  double p, pu, pd;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (j == i) continue;
      p = 1.0 / (r[j] - l[j] + 1);
      for (v = l[j]; v <= r[j]; v++) {
        if (i > j) {
          if (l[i] >= v)
            pu = 1.0;
          else if (r[i] < v) {
            pu = 0.0;
            continue;
          } else
            pu = 1.0 * (r[i] - v + 1) / (r[i] - l[i] + 1);
        } else {
          if (l[i] > v)
            pu = 1.0;
          else if (r[i] <= v) {
            pu = 0.0;
            continue;
          } else
            pu = 1.0 * (r[i] - v + 1 - 1) / (r[i] - l[i] + 1);
        }
        pd = 1.0;
        for (k = 1; k <= n; k++) {
          if (k == i || k == j) continue;
          if (j > k) {
            if (r[k] <= v)
              pd *= 1.0;
            else if (l[k] > v)
              pd *= 0;
            else
              pd *= 1.0 * (v - l[k] + 1) / (r[k] - l[k] + 1);
          } else {
            if (r[k] < v)
              pd *= 1.0;
            else if (l[k] >= v)
              pd *= 0;
            else
              pd *= 1.0 * (v - l[k] + 1 - 1) / (r[k] - l[k] + 1);
          }
        }
        ans += 1.0 * v * p * pu * pd;
      }
    }
  }
}
void out() { printf("%.10f\n", ans); }
int main() {
  while (scanf("%d", &n) != EOF) {
    ini();
    solve();
    out();
  }
  return 0;
}
