#include <bits/stdc++.h>
using namespace std;
pair<int, int> mas[5];
double probs[10001];
int n;
double getprob(int secmax) {
  double prob = 0;
  for (int i = 0; i < pow(3., n); i++) {
    int twos = 0, nonzeros = 0;
    vector<int> bits;
    int i2 = i;
    for (int j = 0; j < n; j++) {
      bits.push_back(i2 % 3);
      i2 /= 3;
    }
    for (int j = 0; j < n; j++) {
      if (bits[j] == 2) twos++;
      if (bits[j] != 0) nonzeros++;
    }
    if (twos > 1) continue;
    if (nonzeros < 2) continue;
    double pr = 1;
    for (int j = 0; j < n; j++) {
      if (bits[j] == 1) {
        if (mas[j].first <= secmax && mas[j].second >= secmax) {
          if (mas[j].first == mas[j].second)
            continue;
          else
            pr /= (mas[j].second - mas[j].first + 1);
        } else {
          pr = 0;
          break;
        }
      } else if (bits[j] == 0) {
        if (mas[j].first >= secmax) {
          pr = 0;
          break;
        } else {
          if (mas[j].second < secmax)
            continue;
          else {
            pr *= (secmax - mas[j].first);
            pr /= (mas[j].second - mas[j].first + 1);
          }
        }
      } else {
        if (mas[j].second <= secmax) {
          pr = 0;
          break;
        } else {
          if (mas[j].first > secmax)
            continue;
          else {
            pr *= (mas[j].second - secmax);
            pr /= (mas[j].second - mas[j].first + 1);
          }
        }
      }
    }
    prob += pr;
  }
  return prob;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> mas[i].first >> mas[i].second;
  }
  for (int secmax = 1; secmax <= 10000; ++secmax) {
    probs[secmax] = getprob(secmax);
  }
  double res = 0;
  for (int i = 1; i <= 10000; ++i) {
    res += probs[i] * i;
  }
  printf("%.10lf\n", res);
  return 0;
}
