#include <bits/stdc++.h>
using namespace std;
double les(pair<int, int> d, int k) {
  double len = d.second - d.first + 1;
  int good = min(d.second + 1, k) - d.first;
  if (good < 0) return 0;
  return 1. * good / len;
}
double big(pair<int, int> d, int k) {
  double len = (d.second - d.first) + 1;
  int good = d.second - max(d.first - 1, k);
  if (good < 0) return 0;
  return 1. * good / len;
}
double eq(pair<int, int> d, int k) {
  double len = (d.second - d.first) + 1;
  if (k >= d.first && k <= d.second) {
    return 1. / len;
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i].first >> v[i].second;
  }
  double ans = 0;
  int poss = 0;
  double curans = 0;
  for (int k = 0; k <= 100000; ++k) {
    for (int i = 1; i < (1 << n); ++i) {
      double ver1 = k;
      double ver2 = 1;
      int cnt = 0;
      for (int q = 0; q < n; ++q) {
        if (i & (1 << q)) {
          ver1 *= eq(v[q], k);
          cnt++;
        } else
          ver2 *= les(v[q], k);
      }
      if (cnt != 1) {
        curans += ver1 * ver2;
      }
      for (int j = 0; j < n; ++j) {
        if (i & (1 << j)) continue;
        double curv = ver1;
        for (int q = 0; q < n; ++q) {
          if (q == j)
            curv *= big(v[q], k);
          else {
            if (!(i & (1 << q))) curv *= les(v[q], k);
          }
        }
        curans += curv;
      }
    }
  }
  printf("%.10lf", curans);
  return 0;
}
