#include <bits/stdc++.h>
using namespace std;
int l[10], r[10];
double p1[10], p2[10], p3[10];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &l[i], &r[i]);
  double p = 0;
  for (int i = 0; i <= 10000; i++) {
    double temp = 1, temp1 = 1, temp2 = 0, temp3 = 1, temp5 = 0;
    for (int j = 0; j < n; j++) {
      if (i < l[j]) {
        p1[j] = p2[j] = 0;
        p3[j] = 1;
      }
      if (l[j] <= i && i <= r[j]) {
        p1[j] = double(i - l[j]) / (r[j] - l[j] + 1);
        p2[j] = 1.0 / (r[j] - l[j] + 1);
        p3[j] = double(r[j] - i) / (r[j] - l[j] + 1);
      }
      if (i > r[j]) {
        p1[j] = 1;
        p2[j] = p3[j] = 0;
      }
    }
    for (int j = 0; j < n; j++) temp1 *= p1[j];
    for (int j = 0; j < n; j++) temp3 *= (1 - p3[j]);
    for (int j = 0; j < n; j++) {
      double temp4 = 1;
      for (int k = 0; k < n; k++) temp4 *= (j == k ? p3[k] : (1 - p3[k]));
      temp2 += temp4;
    }
    for (int j = 0; j < n; j++) {
      double temp4 = 1;
      for (int k = 0; k < n; k++) temp4 *= (j != k ? p1[k] : (1 - p1[k]));
      temp5 += temp4;
    }
    temp = temp2 + temp3 - temp1 - temp5;
    p += i * temp;
  }
  printf("%.12f\n", p);
  return 0;
}
