#include <bits/stdc++.h>
using namespace std;
double answer = 0, Quentity = 0;
void Go(int step, vector<int> IsEqual, int b, int biggest, int& n,
        vector<pair<int, int> >& company) {
  if (step == n) {
    long long Q = 1;
    int NotZero = 0;
    for (int i = 0; i < n; i++)
      if (IsEqual[i] == 1) NotZero++;
    if (NotZero == 0) return;
    for (int i = 0; i < n; i++) {
      if (i == biggest) {
        Q *= (company[i].second - max(b + 1, company[i].first) + 1);
        if (Q < 0) Q = 0;
        continue;
      }
      if (IsEqual[i]) {
        if (b >= company[i].first && b <= company[i].second)
          ;
        else
          Q = 0;
      } else {
        Q *= (min(b - 1, company[i].second) - company[i].first + 1);
        if (Q < 0) Q = 0;
      }
    }
    answer += (Q * b);
    Quentity += Q;
    return;
  }
  if (step == biggest) {
    IsEqual.push_back(10000);
    Go(step + 1, IsEqual, b, biggest, n, company);
    return;
  }
  IsEqual.push_back(1);
  Go(step + 1, IsEqual, b, biggest, n, company);
  IsEqual.pop_back();
  IsEqual.push_back(0);
  Go(step + 1, IsEqual, b, biggest, n, company);
}
void Go(int step, vector<int> IsEqual, int b, int& n,
        vector<pair<int, int> >& company) {
  if (step == n) {
    long long Q = 1;
    int NotZero = 0;
    for (int i = 0; i < n; i++)
      if (IsEqual[i] == 1) NotZero++;
    if (NotZero <= 1) return;
    for (int i = 0; i < n; i++) {
      if (IsEqual[i]) {
        if (b >= company[i].first && b <= company[i].second)
          ;
        else
          Q = 0;
      } else {
        Q *= (min(b - 1, company[i].second) - company[i].first + 1);
        if (Q < 0) Q = 0;
      }
    }
    answer += (Q * b);
    Quentity += Q;
    return;
  }
  IsEqual.push_back(1);
  Go(step + 1, IsEqual, b, n, company);
  IsEqual.pop_back();
  IsEqual.push_back(0);
  Go(step + 1, IsEqual, b, n, company);
}
void solution() {
  int i, n;
  cin >> n;
  vector<pair<int, int> > company(n);
  vector<int> IsEqual;
  for (i = 0; i < n; i++) cin >> company[i].first >> company[i].second;
  int b, biggest;
  for (b = 1; b <= 10000; b++) {
    for (biggest = 0; biggest < n; biggest++) {
      Go(0, IsEqual, b, biggest, n, company);
    }
  }
  for (b = 1; b <= 10000; b++) {
    Go(0, IsEqual, b, n, company);
  }
}
int main() {
  solution();
  cout.precision(10);
  cout << fixed << answer / Quentity << "\n";
  return 0;
}
