#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10;
const int MAXS = 10010;
bool a[MAXN];
long double l[MAXN], r[MAXN];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> l[i] >> r[i];
  long double ans = 0;
  for (int i = 0; i < (1 << n); i++) {
    int cnt = 0;
    for (int j = 0; j < n; j++) {
      a[j] = (i >> j) & 1;
      cnt += a[j];
    }
    if (cnt >= 2)
      for (int j = 1; j <= MAXS; j++) {
        long double prob = 1;
        for (int t = 0; t < n; t++)
          if (a[t]) {
            if (j >= l[t] && j <= r[t])
              prob /= (r[t] - l[t] + 1);
            else
              prob = 0;
          } else if (j - 1 >= l[t])
            prob *=
                (min((long double)j - 1, r[t]) - l[t] + 1) / (r[t] - l[t] + 1);
          else
            prob = 0;
        ans += prob * j;
      }
    if (cnt >= 1)
      for (int t = 0; t < n; t++)
        if (!a[t])
          for (int j = 1; j <= MAXS; j++) {
            long double prob = 1;
            for (int q = 0; q < n; q++)
              if (q == t) {
                if (r[t] >= j + 1)
                  prob *= (r[t] - max((long double)j + 1, l[t]) + 1) /
                          (r[t] - l[t] + 1);
                else
                  prob = 0;
              } else if (a[q])
                if (j >= l[q] && j <= r[q])
                  prob /= (r[q] - l[q] + 1);
                else
                  prob = 0;
              else if (j - 1 >= l[q])
                prob *= (min((long double)j - 1, r[q]) - l[q] + 1) /
                        (r[q] - l[q] + 1);
              else
                prob = 0;
            ans += prob * j;
          }
  }
  cout.precision(12);
  cout << fixed << ans << endl;
  ;
}
