#include <bits/stdc++.h>
using namespace std;
int l[6], r[6];
int main() {
  int i, j, k, t, n, judge;
  double sum, tmp;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d%d", &l[i], &r[i]);
  sum = 0.0;
  for (i = 1; i <= 10000; i++) {
    for (j = 1; j <= n; j++)
      for (k = 1; k <= n; k++) {
        judge = 1;
        if (j == k) judge = 0;
        if (r[j] < i) judge = 0;
        if (r[k] < i || l[k] > i) judge = 0;
        for (t = 1; t <= n; t++)
          if (t != j && t != k && l[t] > i) judge = 0;
        if (judge == 0) continue;
        if (l[j] <= i) {
          if (k < j)
            tmp = 1.0 * (r[j] - i + 1) / (r[j] - l[j] + 1);
          else
            tmp = 1.0 * (r[j] - i) / (r[j] - l[j] + 1);
        } else
          tmp = 1.0;
        tmp = tmp / (r[k] - l[k] + 1);
        for (t = 1; t <= n; t++)
          if (t != j && t != k && r[t] >= i) {
            if (t < k)
              tmp = tmp * (i - l[t] + 1) / (r[t] - l[t] + 1);
            else
              tmp = tmp * (i - l[t]) / (r[t] - l[t] + 1);
          }
        sum = sum + i * tmp;
      }
  }
  printf("%.15lf\n", sum);
}
