#include <bits/stdc++.h>
using namespace std;
vector<int> L, R;
double ls(int k, int nr) {
  if (k <= L[nr]) return 0.;
  if (k > R[nr]) return 1.;
  int dl = R[nr] - L[nr] + 1;
  int ok = k - L[nr];
  return ok * 1. / dl;
}
double eq(int k, int nr) {
  if (k < L[nr] || k > R[nr]) return 0.;
  int dl = R[nr] - L[nr] + 1;
  return 1. / dl;
}
double gr(int k, int nr) {
  if (k < L[nr]) return 1.;
  if (k >= R[nr]) return 0.;
  int dl = R[nr] - L[nr] + 1;
  int ok = R[nr] - k;
  return ok * 1. / dl;
}
int main() {
  int(n);
  scanf("%d", &(n));
  ;
  for (int i = (0); i < (n); ++i) {
    int(a), (b);
    scanf("%d%d", &(a), &(b));
    ;
    L.push_back(a);
    R.push_back(b);
  }
  double res = 0.;
  for (int k = (1); k < (10001); ++k) {
    double p = 0.;
    for (int i = (0); i < (n); ++i) {
      for (int j = (0); j < (n); ++j) {
        if (i != j) {
          double locp = 1.;
          locp *= gr(k, i) * eq(k, j);
          for (int l = (0); l < (j); ++l) {
            if (l != i) locp *= ls(k, l);
          }
          for (int l = (j + 1); l < (n); ++l) {
            if (l != i) locp *= (ls(k, l) + eq(k, l));
          }
          p += locp;
        }
      }
    }
    for (int i = (0); i < (n); ++i) {
      for (int j = (i + 1); j < (n); ++j) {
        double locp = 1.;
        locp *= eq(k, i) * eq(k, j);
        for (int l = (0); l < (j); ++l) {
          if (l != i) locp *= ls(k, l);
        }
        for (int l = (j + 1); l < (n); ++l) locp *= (ls(k, l) + eq(k, l));
        p += locp;
      }
    }
    res += p * k;
  }
  printf("%.17lf\n", res);
}
