#include <bits/stdc++.h>
using namespace std;
int n, mini, maxi;
struct Person {
  int l, r;
} per[10];
double totalsum, sumt;
int main() {
  cin >> n;
  totalsum = 1.0;
  mini = (0x3f3f3f3f) * 2, maxi = -(0x3f3f3f3f) * 2;
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &per[i].l, &per[i].r);
    double t = per[i].r - per[i].l + 1;
    totalsum *= t;
    mini = min(mini, per[i].l), mini = min(mini, per[i].r);
    maxi = max(maxi, per[i].l), maxi = max(maxi, per[i].r);
  }
  sumt = 0;
  for (int now = mini; now <= maxi; now++) {
    double sum1 = 0.0;
    for (int i1 = 0; i1 < n; i1++) {
      if (per[i1].r <= now) continue;
      for (int i = 1; i < 1 << n; i++) {
        if (i & (1 << i1)) continue;
        double sum2 = per[i1].r - max(now + 1, per[i1].l) + 1;
        bool ok = true;
        for (int j = 0; j < n; j++) {
          if (j == i1) continue;
          if ((i & (1 << j)) == 0) {
            if (now <= per[j].l) {
              ok = false;
              break;
            } else {
              double t = min(per[j].r, now - 1) - per[j].l + 1;
              sum2 *= t;
            }
          } else {
            if (per[j].r < now || now < per[j].l) {
              ok = false;
              break;
            }
          }
        }
        if (!ok) continue;
        sum1 += sum2;
      }
    }
    for (int i = 1; i < 1 << n; i++) {
      int num = 0;
      bool ok = true;
      double sum2 = 1.0;
      for (int j = 0; j < n; j++) {
        if ((i & (1 << j)) == 0) {
          if (now <= per[j].l) {
            ok = false;
            break;
          } else {
            double t = min(per[j].r, now - 1) - per[j].l + 1;
            sum2 *= t;
          }
        } else {
          num += 1;
          if (per[j].r < now || now < per[j].l) {
            ok = false;
            break;
          }
        }
      }
      if (num < 2 || !ok) continue;
      sum1 += sum2;
    }
    sumt += now * sum1;
  }
  double ans = sumt / totalsum;
  printf("%.10f\n", ans);
}
