#include <bits/stdc++.h>
using namespace std;
long double truncDif(int a, int b) { return max(b - a + 1, 0); }
int n;
int l[10], r[10];
long double sum;
void f(int i, int k, int c, long double p) {
  if (i == n) {
    if (k >= 2) sum += p;
  } else {
    if (l[i] <= c && c <= r[i]) f(i + 1, k + 1, c, p / truncDif(l[i], r[i]));
    f(i + 1, k, c, p * truncDif(l[i], min(c - 1, r[i])) / truncDif(l[i], r[i]));
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> l[i] >> r[i];
  long double ans = 0;
  for (int c = 1; c <= 10000; ++c) {
    long double prob = 0;
    for (int k1 = 0; k1 < n; ++k1) {
      long double p = 1;
      p *= truncDif(max(c + 1, l[k1]), r[k1]) / truncDif(l[k1], r[k1]);
      long double p1 = 1;
      long double p2 = 1;
      for (int i = 0; i < n; ++i)
        if (i != k1) {
          p1 *= truncDif(l[i], min(c, r[i])) / truncDif(l[i], r[i]);
          p2 *= truncDif(l[i], min(c - 1, r[i])) / truncDif(l[i], r[i]);
        }
      p *= p1 - p2;
      prob += p;
    }
    sum = 0;
    f(0, 0, c, 1);
    ans += c * (prob + sum);
  }
  cout.setf(ios::fixed);
  cout.precision(10);
  cout << ans << '\n';
  return 0;
}
