#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 3000000;
int a[MAX_N];
struct Node {
  int b;
  string s;
  Node() { s = ""; }
  Node(int _b, string _s) {
    b = _b;
    s = _s;
  }
  bool operator<(const Node &rhs) const {
    if (b == rhs.b) return s < rhs.s;
    return b > rhs.b;
  }
};
const int N = 10;
int l[N], r[N];
double p1[N], p2[N], p3[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &l[i], &r[i]);
  }
  double p = 0.0;
  for (int i = 0; i <= 10000; i++) {
    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;
    }
    double tmp = 1, tmp1 = 1, tmp2 = 0, tmp3 = 1, tmp5 = 0;
    for (int j = 0; j < n; j++) tmp1 *= p1[j];
    for (int j = 0; j < n; j++) tmp3 *= (1 - p3[j]);
    for (int j = 0; j < n; j++) {
      double tmp4 = 1;
      for (int k = 0; k < n; k++)
        if (j != k)
          tmp4 *= (1 - p3[k]);
        else
          tmp4 *= p3[k];
      tmp2 += tmp4;
    }
    for (int j = 0; j < n; j++) {
      double tmp4 = 1;
      for (int k = 0; k < n; k++)
        if (j != k)
          tmp4 *= p1[k];
        else
          tmp4 *= (1 - p1[k]);
      tmp5 += tmp4;
    }
    tmp = tmp2 + tmp3 - tmp1 - tmp5;
    p += i * tmp;
  }
  printf("%.9f\n", p);
  return 0;
}
