#include <bits/stdc++.h>
using namespace std;
int N;
int L[10], R[10];
double ans;
bool udah[1 << 5];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d%d", &L[i], &R[i]);
  }
  ans = 0;
  for (int sec = 0; sec <= 10000; sec++) {
    double chance = 0;
    int perm[N];
    for (int seri = 1; seri <= N - 1; seri++) {
      int p = 0;
      for (int i = 0; i < N - seri - 1; i++) {
        perm[p++] = 0;
      }
      for (int i = 0; i < seri; i++) {
        perm[p++] = 1;
      }
      perm[p++] = 2;
      do {
        double ch = 1;
        for (int i = 0; i < N; i++) {
          int l = L[i];
          int r = R[i];
          double len = (R[i] - L[i] + 1);
          if (perm[i] == 0) {
            r = min(r, sec - 1);
          } else if (perm[i] == 1) {
            l = max(l, sec);
            r = min(r, sec);
          } else {
            l = max(l, sec + 1);
          }
          if (l <= r) {
            ch *= (r - l + 1) / len;
          } else {
            ch = 0;
          }
        }
        chance += ch;
      } while (next_permutation(perm, perm + p));
    }
    for (int seri = 2; seri <= N; seri++) {
      int p = 0;
      for (int i = 0; i < N - seri; i++) {
        perm[p++] = 0;
      }
      for (int i = 0; i < seri; i++) {
        perm[p++] = 1;
      }
      do {
        double ch = 1;
        for (int i = 0; i < N; i++) {
          int l = L[i];
          int r = R[i];
          double len = (R[i] - L[i] + 1);
          if (perm[i] == 0) {
            r = min(r, sec - 1);
          } else if (perm[i] == 1) {
            l = max(l, sec);
            r = min(r, sec);
          }
          if (l <= r) {
            ch *= (r - l + 1) / len;
          } else {
            ch = 0;
          }
        }
        chance += ch;
      } while (next_permutation(perm, perm + p));
    }
    ans += chance * sec;
  }
  printf("%.12lf\n", ans);
  return 0;
}
