#include <bits/stdc++.h>
using namespace std;
void solve(int test_number);
int main() {
  ios_base::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(9);
  cerr.setf(ios::fixed);
  cerr.precision(3);
  int n = 1;
  for (int i = 0; i < (int)n; i++) solve(i);
}
int L[6];
int R[6];
int len[6];
int n;
const double eps = 1.0e-6;
void go(int x, int step, double cur) {}
void solve(int test_number) {
  scanf("%d", &n);
  for (int i = 0; i < (int)n; i++) {
    scanf("%d%d", &L[i], &R[i]);
    len[i] = R[i] - L[i] + 1;
  }
  double answer = 0.0;
  double sum = 0.0;
  for (int x = (int)1; x <= (int)10000; x++)
    for (int prof = 0; prof < (int)(1 << n); prof++) {
      int cnt = 0;
      double prob = 1.0;
      for (int number = 0; number < (int)n; number++)
        if (prof & (1 << number)) {
          cnt++;
          if (x >= L[number] && x <= R[number])
            prob *= 1.0 / len[number];
          else
            prob = 0.0;
        } else if (x <= R[number]) {
          prob *= (double)max(0, x - L[number]) / len[number];
        }
      if (cnt >= 2) {
        sum += prob;
        answer += prob * x;
      }
    }
  for (int x = (int)1; x <= (int)10000; x++)
    for (int best = 0; best < (int)n; best++)
      for (int prof = 0; prof < (int)(1 << n); prof++)
        if (!(prof & (1 << best))) {
          int cnt = 0;
          if (R[best] <= x) continue;
          double prob =
              (x >= L[best] ? (double)(R[best] - x) / len[best] : 1.0);
          for (int number = 0; number < (int)n; number++)
            if (prof & (1 << number)) {
              cnt++;
              if (x >= L[number] && x <= R[number])
                prob *= 1.0 / len[number];
              else
                prob = 0.0;
            } else if (number != best && x <= R[number]) {
              prob *= (double)max(0, x - L[number]) / len[number];
            }
          if (cnt != 0) {
            sum += prob;
            answer += prob * x;
          }
        }
  printf("%.10lf\n", answer);
}
