#include <bits/stdc++.h>
using namespace std;
int n;
int L[10], R[10];
int F[10];
double prob(int k) {
  double ans = 1.0;
  for (int i = 0; i <= n - 1; i++) {
    if (F[i] == 0) {
      if (L[i] < k)
        ans *= (min(k, R[i] + 1) - L[i]) * 1.0 / (R[i] - L[i] + 1);
      else
        return 0.0;
    } else if (F[i] == 1) {
      if (L[i] <= k && k <= R[i])
        ans *= 1.0 / (R[i] - L[i] + 1);
      else
        return 0.0;
    } else {
      if (k < R[i])
        ans *= (R[i] - max(k, L[i] - 1)) * 1.0 / (R[i] - L[i] + 1);
      else
        return 0.0;
    }
  }
  return ans;
}
void imp(int F[]) {
  for (int i = 0; i <= n - 1; i++) cout << " " << F[i];
  cout << endl;
}
double solve(int k) {
  double ans = 0.0;
  for (int i = 0; i <= n - 2; i++) {
    for (int j = 0; j <= i - 1; j++) F[j] = 0;
    for (int j = i; j <= n - 1; j++) F[j] = 1;
    F[n - 1] = 2;
    do {
      ans += prob(k);
    } while (next_permutation(F, F + n));
  }
  for (int i = 0; i <= n - 2; i++) {
    for (int j = 0; j <= i - 1; j++) F[j] = 0;
    for (int j = i; j <= n - 1; j++) F[j] = 1;
    do {
      ans += prob(k);
    } while (next_permutation(F, F + n));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> L[i] >> R[i];
  }
  double ans = 0.0;
  for (int i = 1; i <= 10005; i++) {
    ans += solve(i) * i;
  }
  printf("%.10lf\n", ans);
  return 0;
}
