#include <bits/stdc++.h>
using namespace std;
inline int max(int a, int b) { return a < b ? b : a; }
inline int min(int a, int b) { return a > b ? b : a; }
inline long long max(long long a, long long b) { return a < b ? b : a; }
inline long long min(long long a, long long b) { return a > b ? b : a; }
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
const long long INF = 1e18;
pair<long long, long long> arr[10];
int n;
long double tot = 1;
long double calc(long long x) {
  long double less = 1;
  for (int i = 0; i < n; ++i) {
    if (arr[i].first > x - 1)
      less = 0;
    else {
      long long y = min(arr[i].second, x - 1);
      less *= (y - arr[i].first + 1);
    }
  }
  for (int i = 0; i < n; ++i) {
    long double sum = 1;
    for (int j = 0; j < n; ++j)
      if (i != j) {
        if (arr[j].first > x - 1)
          sum = 0;
        else {
          long long y = min(arr[j].second, x - 1);
          sum *= (y - arr[j].first + 1);
        }
      } else {
        if (arr[j].second < x)
          sum = 0;
        else {
          long long y = max(x, arr[j].first);
          sum *= (arr[j].second - y + 1);
        }
      }
    less += sum;
  }
  return tot - less;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%lld%lld", &arr[i].first, &arr[i].second);
  for (int i = 0; i < n; ++i) tot *= (arr[i].second - arr[i].first + 1);
  long double ans = 0;
  for (int i = 1; i < 10001; ++i) {
    ans += calc(i);
  }
  ans /= tot;
  printf("%.10lf\n", (double)ans);
  return 0;
}
