#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  long long x = 0;
  int 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;
}
inline void rt(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10)
    rt(x / 10), putchar(x % 10 + '0');
  else
    putchar(x + '0');
}
string ssin = "data00.in";
string sout = "data00.out";
const int maxn = 205;
int n, l[maxn], r[maxn];
double Prob_leq_l[maxn], Prob_le_l[maxn];
double Prob_leq_r[maxn], Prob_le_r[maxn];
double Solve(int val) {
  double ret = 0;
  for (int i = int(1); i <= (int)(n); i++) {
    if (r[i] <= val) continue;
    ret += (Prob_leq_l[i - 1] * Prob_leq_r[i + 1] -
            Prob_le_l[i - 1] * Prob_le_r[i + 1]) *
           (l[i] > val ? 1 : 1.0 * (r[i] - val) / (r[i] - l[i] + 1));
  }
  return ret;
}
double Solve2(int val) {
  double Prob_sec_le_b = 0;
  for (int i = int(1); i <= (int)(n); i++) {
    if (l[i] <= val && val <= r[i]) {
      Prob_sec_le_b +=
          1.0 / (r[i] - l[i] + 1) * Prob_le_l[i - 1] * Prob_le_r[i + 1];
    }
  }
  return Prob_leq_l[n] - Prob_le_l[n] - Prob_sec_le_b;
}
int main() {
  n = rd();
  int Max = 0;
  for (int i = int(1); i <= (int)(n); i++)
    l[i] = rd(), r[i] = rd(), Max = max(Max, r[i]);
  double Ans = 0;
  for (int i = int(1); i <= (int)(Max); i++) {
    Prob_leq_l[0] = 1;
    Prob_le_l[0] = 1;
    for (int j = int(1); j <= (int)(n); j++) {
      Prob_le_l[j] = Prob_le_l[j - 1];
      if (l[j] >= i)
        Prob_le_l[j] = 0;
      else if (r[j] >= i)
        Prob_le_l[j] *= 1.0 * (i - l[j]) / (r[j] - l[j] + 1);
      Prob_leq_l[j] = Prob_leq_l[j - 1];
      if (l[j] > i)
        Prob_leq_l[j] = 0;
      else if (r[j] > i)
        Prob_leq_l[j] *= 1.0 * (i - l[j] + 1) / (r[j] - l[j] + 1);
    }
    Prob_leq_r[n + 1] = 1;
    Prob_le_r[n + 1] = 1;
    for (int j = int(n); j >= (int)(1); j--) {
      Prob_le_r[j] = Prob_le_r[j + 1];
      if (l[j] >= i)
        Prob_le_r[j] = 0;
      else if (r[j] >= i)
        Prob_le_r[j] *= 1.0 * (i - l[j]) / (r[j] - l[j] + 1);
      Prob_leq_r[j] = Prob_leq_r[j + 1];
      if (l[j] > i)
        Prob_leq_r[j] = 0;
      else if (r[j] > i)
        Prob_leq_r[j] *= 1.0 * (i - l[j] + 1) / (r[j] - l[j] + 1);
    }
    Ans += (Solve(i) + Solve2(i)) * i;
  }
  printf("%.13lf\n", Ans);
}
