#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  double answer = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (j != i) {
        for (int k = a[i]; k <= b[i]; k++) {
          double ans = k;
          int p = 0;
          for (int l = 0; l < n; l++) {
            if (l == i)
              continue;
            else if (l == j) {
              if (b[j] < k)
                ans = 0;
              else if (a[j] <= k) {
                if (i > j)
                  ans *= (b[j] - k);
                else
                  ans *= (b[j] - k + 1);
              } else
                ans *= (b[j] - a[j] + 1);
            } else {
              if (a[l] > k)
                ans = 0;
              else if (b[l] >= k) {
                if (l > i)
                  ans *= (k - a[l]);
                else
                  ans *= (k - a[l] + 1);
              } else
                ans *= (b[l] - a[l] + 1);
            }
            while (p < n && ans > (b[p] - a[p] + 1)) {
              ans /= (b[p] - a[p] + 1);
              p++;
            }
          }
          while (p < n) {
            ans /= (b[p] - a[p] + 1);
            p++;
          }
          answer += ans;
        }
      }
  printf("%.10f\n", answer);
  return 0;
}
