#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> Left, Right;
long double GetUpProb(int cost, int index) {
  if (Right[index] < cost) return 0.0;
  return static_cast<long double>(Right[index] + 1 -
                                  max(cost + 1, Left[index])) /
         static_cast<long double>(Right[index] + 1 - Left[index]);
}
long double GetLowProb(int cost, int index) {
  if (Left[index] > cost) return 0.0;
  return static_cast<long double>(min(cost, Right[index] + 1) - Left[index]) /
         static_cast<long double>(Right[index] + 1 - Left[index]);
}
long double GetEqProb(int cost, int index) {
  if (Right[index] < cost || Left[index] > cost) return 0.0;
  return static_cast<long double>(1) /
         static_cast<long double>(Right[index] + 1 - Left[index]);
}
int main() {
  cin >> n;
  Left.resize(n);
  Right.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> Left[i] >> Right[i];
  }
  long double Ef = 0.0;
  for (int cost = 1; cost < 10001; ++cost) {
    for (int w_index = 0; w_index < n; ++w_index) {
      long double prob = GetUpProb(cost, w_index);
      for (int l_index = 0; l_index < n; ++l_index) {
        if (l_index != w_index) {
          prob *= (GetLowProb(cost, l_index) + GetEqProb(cost, l_index));
        }
      }
      Ef += prob * cost;
      prob = GetUpProb(cost, w_index);
      for (int l_index = 0; l_index < n; ++l_index) {
        if (l_index != w_index) {
          prob *= GetLowProb(cost, l_index);
        }
      }
      Ef -= prob * cost;
    }
    for (int mask = 0; mask < (1 << n); ++mask) {
      long double prob = 1.0;
      int i = 0;
      for (int index = 0; index < n; ++index) {
        if ((mask >> index) % 2) {
          ++i;
          prob *= GetEqProb(cost, index);
        } else {
          prob *= GetLowProb(cost, index);
        }
      }
      if (i > 1) {
        Ef += prob * cost;
      }
    }
  }
  printf("%.10lf\n", static_cast<double>(Ef));
}
