#include <bits/stdc++.h>
using namespace std;
struct COM {
  int l, r;
};
COM company[10];
int main() {
  ios::sync_with_stdio(false);
  double total, ans;
  int n, mn, mx;
  cin >> n;
  total = 1.0;
  mn = (0x3f3f3f3f) * 2;
  mx = -(0x3f3f3f3f) * 2;
  for (__typeof(0) i = (0); i < (n); i += 1) {
    cin >> company[i].l >> company[i].r;
    double t = company[i].r - company[i].l + 1;
    total *= t;
    mn = min(mn, company[i].l);
    mn = min(mn, company[i].r);
    mx = max(mx, company[i].l);
    mx = max(mx, company[i].r);
  }
  ans = 0;
  for (__typeof(mn) now = (mn); now < (mx + 1); now += 1) {
    double s = 0.0;
    for (__typeof(0) k = (0); k < (n); k += 1) {
      if (company[k].r <= now) {
        continue;
      }
      for (__typeof(1) i = (1); i < (1 << n); i += 1) {
        if (i & (1 << k)) {
          continue;
        }
        double ans = company[k].r - max(now + 1, company[k].l) + 1;
        bool ok = true;
        for (__typeof(0) j = (0); j < (n); j += 1) {
          if (j == k) {
            continue;
          }
          if ((i & (1 << j)) == 0) {
            if (now <= company[j].l) {
              ok = false;
              break;
            } else {
              double t = min(company[j].r, now - 1) - company[j].l + 1;
              ans *= t;
            }
          } else {
            if (company[j].r < now || now < company[j].l) {
              ok = false;
              break;
            }
          }
        }
        if (!ok) {
          continue;
        }
        s += ans;
      }
    }
    for (__typeof(1) i = (1); i < (1 << n); i += 1) {
      int num = 0;
      bool ok = true;
      double ans = 1.0;
      for (__typeof(0) j = (0); j < (n); j += 1) {
        if ((i & (1 << j)) == 0) {
          if (now <= company[j].l) {
            ok = false;
            break;
          } else {
            double t = min(company[j].r, now - 1) - company[j].l + 1;
            ans *= t;
          }
        } else {
          num++;
          if (company[j].r < now || now < company[j].l) {
            ok = false;
            break;
          }
        }
      }
      if (num < 2 || !ok) {
        continue;
      }
      s += ans;
    }
    ans += now * s;
  }
  cout << fixed << setprecision(10) << ans / total << endl;
  return 0;
}
