#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 1;
const int N = 1000002;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long power(long long A, long long B, long long mod = 1000000007) {
  long long r = 1;
  while (B > 0) {
    if (B & 1LL) r = (r * A) % mod;
    A = (A * A) % mod;
    B >>= 1;
  }
  return r;
}
struct set_comp {
  bool operator()(const int& lhs, const int& rhs) { return lhs < rhs; }
};
struct prob_vals {
  double eq, lt, gt;
};
int n;
int L[5], R[5];
double expt = 0;
double f(int x) {
  vector<prob_vals> v;
  int i, j, k;
  for (i = 0; i < n; i++) {
    double g = 0, e = 0, l = 0;
    if (x >= L[i] and x <= R[i]) {
      e = 1.0 / (R[i] - L[i] + 1);
      l = 1.0 * (x - L[i]) / (R[i] - L[i] + 1);
      g = 1.0 * (R[i] - x) / (R[i] - L[i] + 1);
    } else if (x < L[i]) {
      g = 1;
    } else if (x > R[i]) {
      l = 1;
    }
    v.push_back({e, l, g});
  }
  double ans = 0;
  for (k = -1; k < n; k++) {
    vector<int> temp;
    double term = (k != -1) ? v[k].gt : 1;
    if (term == 0) continue;
    for (j = 0; j < n; j++) {
      if (j != k) temp.push_back(j);
    }
    int sz = temp.size();
    for (i = 1; i <= ((1 << sz) - 1); i++) {
      vector<int> ve, vl;
      for (j = 0; j < sz; j++) {
        if (i & (1 << j)) {
          ve.push_back(j);
        } else {
          vl.push_back(j);
        }
      }
      if (ve.size() == 0) continue;
      if (ve.size() <= 1 and k == -1) continue;
      double prob = 1;
      for (j = 0; j < ve.size(); j++) {
        int x = ve[j];
        int cid = temp[x];
        prob *= v[cid].eq;
      }
      for (j = 0; j < vl.size(); j++) {
        int x = vl[j];
        int cid = temp[x];
        prob *= v[cid].lt;
      }
      prob *= term;
      ans = ans + prob;
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  int i, maxv = 0, minv = 1000000007;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> L[i] >> R[i];
    maxv = max(maxv, max(R[i], L[i]));
    minv = min(minv, min(R[i], L[i]));
  }
  double expt = 0;
  for (i = minv; i <= maxv; i++) {
    expt += i * f(i);
  }
  cout << fixed << setprecision(10) << expt << endl;
  return 0;
}
