#include <bits/stdc++.h>
using namespace std;
const double eps = (1e-9);
const long long mod = 998244353;
int L[20], R[20];
int main() {
  int n;
  scanf("%d", &n);
  int Lb = 10000010, Rb = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &L[i], &R[i]);
    Rb = max(Rb, R[i]);
    Lb = min(Lb, L[i]);
  }
  double ans = 0;
  for (int x = 1; x <= 10000; x++) {
    double p0 = 0;
    for (int i = 1; i <= n; i++) {
      if (R[i] < x) continue;
      for (int j = 1; j <= n; j++) {
        if (i == j || L[j] > x || R[j] < x) continue;
        double p1 = 1.0 / (R[j] - L[j] + 1.0);
        p1 *= ((R[i] - max(x + (i < j), L[i]) + 1.0) / (R[i] - L[i] + 1.0));
        for (int k = 1; k <= n; k++) {
          if (k == i || k == j) continue;
          p1 *= max(
              0.0, (min(x - (k > j), R[k]) - L[k] + 1.0) / (R[k] - L[k] + 1.0));
        }
        p0 += p1;
      }
    }
    ans += (p0 * x);
  }
  printf("%.9f\n", ans);
  return 0;
}
