#include <bits/stdc++.h>
using namespace std;
struct Price {
  int l;
  int r;
};
vector<Price> prices;
bool inc(vector<int> &indexes) {
  for (unsigned int i = 0; i < indexes.size(); i++) {
    if (indexes[i] < 2) {
      indexes[i]++;
      for (int j = i - 1; j >= 0; j--) indexes[j] = 0;
      return true;
    }
  }
  return false;
}
bool check(vector<int> &indexes, int b) {
  int numEquals = 0;
  int numGreaters = 0;
  for (unsigned int i = 0; i < indexes.size(); i++) {
    if (indexes[i] == 0) {
      numGreaters++;
      if (prices[i].r < b + 1) return false;
    } else if (indexes[i] == 1) {
      numEquals++;
      if (prices[i].l > b || prices[i].r < b) return false;
    } else {
      if (prices[i].l > b - 1) return false;
    }
  }
  if (numEquals < 1) return false;
  if (numGreaters > 1 || (numGreaters == 0 && numEquals < 2)) return false;
  return true;
}
long double getP(int b) {
  int n = prices.size();
  vector<int> indexes(prices.size(), 0);
  long double prob = 0;
  do {
    if (check(indexes, b)) {
      int numEquals = 0;
      for (int i = 0; i < n; i++) {
        if (indexes[i] == 1) numEquals++;
      }
      long double pb = 1.0;
      for (int i = 0; i < n; i++) {
        if (indexes[i] == 0) {
          int left = max(b + 1, prices[i].l);
          int right = prices[i].r;
          pb *= (right - left + 1) * 1.0 / (prices[i].r - prices[i].l + 1);
        } else if (indexes[i] == 1) {
          pb *= 1.0 / (prices[i].r - prices[i].l + 1);
        } else {
          int left = prices[i].l;
          int right = min(b - 1, prices[i].r);
          pb *= (right - left + 1) * 1.0 / (prices[i].r - prices[i].l + 1);
        }
      }
      prob += pb;
    }
  } while (inc(indexes));
  return prob;
}
int main() {
  int n;
  cin >> n;
  prices.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> prices[i].l >> prices[i].r;
  }
  long double res = 0;
  for (int b = 1; b <= 10000; b++) {
    res += b * 1.0 * getP(b);
  }
  cout.precision(11);
  cout << res;
}
