#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int nmax = 10000;
const double e = 1e-13;
const double PI = acos(-1);
int n, m, stest;
int a[10], b[10];
double dp[10][100][2];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i] >> b[i];
  double res = 0;
  for (int price = 1; price <= 10000; price++) {
    for (int i = 0; i <= n; i++)
      for (int j = 0; j <= (1 << (n)) - 1; j++)
        for (int t = 0; t <= 1; t++) dp[i][j][t] = 0;
    dp[0][0][0] = 1;
    for (int i = 0; i <= n - 1; i++)
      for (int j = 0; j <= (1 << (n)) - 1; j++)
        for (int t = 0; t <= 1; t++)
          if (dp[i][j][t] > e) {
            double x = dp[i][j][t];
            if (a[i + 1] < price)
              dp[i + 1][j][t] += x * (min(price - 1, b[i + 1]) - a[i + 1] + 1) /
                                 (b[i + 1] - a[i + 1] + 1);
            if (a[i + 1] <= price && price <= b[i + 1])
              dp[i + 1][j + (1 << (i))][t] +=
                  x * 1.0 / (b[i + 1] - a[i + 1] + 1);
            if (b[i + 1] > price && t == 0)
              dp[i + 1][j][1] += x * (b[i + 1] - max(price + 1, a[i + 1]) + 1) /
                                 (b[i + 1] - a[i + 1] + 1);
          }
    for (int i = 1; i <= (1 << (n)) - 1; i++) {
      res += dp[n][i][1] * price;
      if (__builtin_popcount(i) >= 2) res += dp[n][i][0] * price;
    }
  }
  printf("%.10lf\n", res);
  return 0;
}
