#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
inline long FastMax(long x, long y) {
  return (((y - x) >> (32 - 1)) & (x ^ y)) ^ y;
}
inline long FastMin(long x, long y) {
  return (((y - x) >> (32 - 1)) & (x ^ y)) ^ x;
}
long IR[] = {0, -1, 0, 1, -1, -1, 1, 1};
long IC[] = {1, 0, -1, 0, 1, -1, -1, 1};
long n;
long L[77 + 7];
long R[77 + 7];
bool vi[7][7][10007][2];
double pr[7][7][10007][2];
inline long max(long a, long b) { return a > b ? a : b; }
double Find(long i, long w, long a, bool u) {
  if (i > n) return u == true;
  if (vi[i][w][a][u]) return pr[i][w][a][u];
  vi[i][w][a][u] = true;
  if (i == w) return pr[i][w][a][u] = Find(i + 1, w, a, u);
  pr[i][w][a][u] = 0;
  if (L[i] <= a and R[i] >= a)
    pr[i][w][a][u] += (1.0 / (R[i] - L[i] + 1)) * Find(i + 1, w, a, true);
  long max_i = min(a - 1, R[i]);
  if (L[i] <= max_i)
    pr[i][w][a][u] +=
        ((max_i - L[i] + 1.0) / (R[i] - L[i] + 1)) * Find(i + 1, w, a, u);
  return pr[i][w][a][u];
}
double tryAll(long i, long a, long u) {
  if (i > n) return u >= 2;
  double p = 0;
  if (L[i] <= a and R[i] >= a)
    p += (1.0 / (R[i] - L[i] + 1)) * tryAll(i + 1, a, u + 1);
  long max_i = min(a - 1, R[i]);
  if (L[i] <= max_i)
    p += ((max_i - L[i] + 1.0) / (R[i] - L[i] + 1)) * tryAll(i + 1, a, u);
  return p;
}
int main(void) {
  long long i, j, a, w, Icase;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> L[i] >> R[i];
  }
  double ans = 0;
  for (a = 1; a <= 10000; a++) {
    double p;
    for (w = 1; w <= n; w++) {
      long min_w = max(a + 1, L[w]);
      if (min_w > R[w]) continue;
      double p = Find(1, w, a, false);
      p *= (R[w] - min_w + 1.0) / (R[w] - L[w] + 1.0);
      ans += p * a;
    }
    ans += tryAll(1, a, 0) * a;
  }
  printf("%.10lf\n", ans);
  return 0;
}
