#include <bits/stdc++.h>
using namespace std;
struct seg {
  int x, y;
} seg[11];
int n;
double prob(double x) {
  if (x < 0) return 0;
  if (x > 1) return 1;
  return x;
}
int tri[11];
double res = 0;
int between(int a, int b, int x) { return a <= x && x <= b; }
void dfs(int now, int v) {
  if (now >= n) {
    int cnt[4];
    memset(cnt, 0, sizeof(cnt));
    for (int i = 0; i < n; i++) cnt[tri[i]]++;
    if (cnt[2] > 1 || cnt[1] == 0 || cnt[1] + cnt[2] == 1) return;
    double e = v;
    for (int i = 0; i < n; i++) {
      if (tri[i] == 2) {
        e *= prob(1.0 * (seg[i].y - v) / (seg[i].y - seg[i].x + 1));
      } else if (tri[i] == 1) {
        e *= 1.0 * between(seg[i].x, seg[i].y, v) / (seg[i].y - seg[i].x + 1);
      } else {
        e *= prob(1.0 * (v - seg[i].x) / (seg[i].y - seg[i].x + 1));
      }
    }
    res += e;
    return;
  }
  for (int i = 0; i < 3; i++) {
    tri[now] = i;
    dfs(now + 1, v);
  }
}
void input() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &seg[i].x, &seg[i].y);
}
void solve() {
  for (int i = 1; i <= 10000; i++) {
    dfs(0, i);
  }
  printf("%.11f\n", res);
}
int main() {
  int zz = 1;
  while (zz--) {
    input();
    solve();
  }
}
