#include <bits/stdc++.h>
using namespace std;
inline int IN() {
  int x = 0, ch = getchar(), f = 1;
  while (!isdigit(ch) && (ch != '-') && (ch != EOF)) ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, l[6], r[6];
double Solve(int val) {
  double ret = 0;
  for (int i = 1; i <= n; i++) {
    if (r[i] < val) continue;
    bool f1 = 1, f2 = 0;
    for (int j = 1; j <= n; j++)
      if (j != i) {
        if (l[j] <= val && r[j] >= val) f2 = 1;
        if (l[j] > val) f1 = 0;
      }
    if (!f1 || !f2) continue;
    double gl = l[i] > val ? 1 : 1.0 * (r[i] - val) / (r[i] - l[i] + 1);
    double gl1 = 1, gl2 = 1;
    for (int j = 1; j <= n; j++) {
      if (r[j] < val || j == i) continue;
      gl1 *= 1.0 * (val - l[j] + 1) / (r[j] - l[j] + 1);
      gl2 *= 1.0 * (val - l[j]) / (r[j] - l[j] + 1);
    }
    ret += (gl1 - gl2) * gl;
  }
  return ret;
}
double Solve2(int val) {
  bool f1 = 1, f2 = 0;
  for (int i = 1; i <= n; i++) {
    if (l[i] <= val && r[i] >= val) f2 = 1;
    if (l[i] > val) f1 = 0;
  }
  if (!f1 || !f2) return 0;
  double gl1 = 1.0, gl2 = 1.0, gl3 = 0;
  for (int i = 1; i <= n; i++) {
    if (r[i] < val) continue;
    gl1 *= 1.0 * (val - l[i] + 1) / (r[i] - l[i] + 1);
    gl2 *= 1.0 * (val - l[i]) / (r[i] - l[i] + 1);
  }
  for (int i = 1; i <= n; i++) {
    if (l[i] <= val && val <= r[i]) {
      double tsg = 1.0 / (r[i] - l[i] + 1);
      for (int j = 1; j <= n; j++) {
        if (j == i || r[j] < val) continue;
        tsg *= 1.0 * (val - l[j]) / (r[j] - l[j] + 1);
      }
      gl3 += tsg;
    }
  }
  return gl1 - gl2 - gl3;
}
int main() {
  n = IN();
  int Max = 0;
  for (int i = 1; i <= n; i++) l[i] = IN(), r[i] = IN(), Max = max(Max, r[i]);
  double Ans = 0;
  for (int i = 1; i <= Max; i++) Ans += (Solve(i) + Solve2(i)) * i;
  printf("%.13lf\n", Ans);
}
