#include <bits/stdc++.h>
using namespace std;
const int N = 7;
int n;
double ans, now, tmp, sum;
int l[N], r[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d%d", l + i, r + i);
  for (int x = 1; x <= n; ++x) {
    for (int i = l[x]; i <= r[x]; ++i) {
      for (int y = 1; y <= n; ++y) {
        if (x == y) continue;
        sum = i * 1.0 / (r[x] - l[x] + 1);
        for (int j = 1; j <= n; ++j) {
          if (j == x) continue;
          now = i - l[j] + (j > x);
          tmp = max(0.0, min(1.0, now * 1.0 / (r[j] - l[j] + 1)));
          if (j == y)
            sum *= (1 - tmp);
          else
            sum *= tmp;
        }
        ans += sum;
      }
    }
  }
  printf("%.10f\n", ans);
  return 0;
}
