#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int arr[10][2];
  for (long long int i = 0; i < n; i += 1) cin >> arr[i][0] >> arr[i][1];
  long double dp[10][10005];
  memset(dp, 0, sizeof(dp));
  for (long long int i = 0; i < n; i += 1) {
    for (long long int j = 0; j < 10004; j += 1) {
      if (j > arr[i][1]) continue;
      long double curr = 0;
      vector<long long int> itr;
      for (long long int k = 0; k < n; k += 1) {
        if (k != i) itr.push_back(k);
      }
      long long int sz = itr.size();
      long double bitmask[50];
      long double total = 0;
      for (long long int k = 1; k < 1 << sz; k += 1) {
        long double curr2 = 1;
        for (long long int l = 0; l < sz; l += 1) {
          if (k & (1 << l)) {
            long long int id = itr[l];
            if (j <= arr[id][1] && j >= arr[id][0]) {
              curr2 /= (arr[id][1] - arr[id][0] + 1);
            } else
              curr2 = 0;
          } else {
            long long int id = itr[l];
            if (arr[id][1] < j) {
              continue;
            }
            if (arr[id][0] >= j)
              curr2 = 0;
            else
              curr2 *= 1.0 * (j - arr[id][0]) / (arr[id][1] - arr[id][0] + 1);
          }
        }
        bitmask[k] = curr2;
        total += curr2;
      }
      if (j >= arr[i][0])
        dp[i][j] = total * (arr[i][1] - j) * 1.0 / (arr[i][1] - arr[i][0] + 1);
      else
        dp[i][j] = total;
      long double total2 = 0;
      if (j <= arr[i][1] && j >= arr[i][0]) {
        for (long long int k = 1; k < 1 << sz; k += 1) {
          long long int cnt4 = 0;
          for (long long int l = 0; l < sz; l += 1) {
            if (k & (1 << l)) cnt4++;
          }
          total2 += bitmask[k] / (cnt4 + 1);
        }
      }
      dp[i][j] += total2 / (arr[i][1] - arr[i][0] + 1);
    }
  }
  long double dp2[10005], res = 0;
  memset(dp2, 0, sizeof(dp2));
  for (long long int i = 0; i < 10004; i += 1) {
    for (long long int j = 0; j < n; j += 1) {
      dp2[i] += dp[j][i];
    }
    res += i * dp2[i];
  }
  cout << fixed << setprecision(10) << res << endl;
  return 0;
}
