#include <bits/stdc++.h>
using namespace std;
void read(long long &a) {
  a = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    a = (a << 1) + (a << 3) + c - '0';
    c = getchar();
  }
}
long long Set(long long n, long long pos) { return n = n | (1LL << pos); }
long long reset(long long n, long long pos) { return n = n & ~(1LL << pos); }
bool check(long long n, long long pos) { return (bool)(n & (1LL << pos)); }
long long mul(long long a, long long b) {
  long long c;
  c = (a % 1000000007 * b % 1000000007) % 1000000007;
  return c;
}
long long add(long long a, long long b) {
  long long c;
  c = (a % 1000000007 + b % 1000000007) % 1000000007;
  return c;
}
long long sub(long long a, long long b) {
  long long c;
  c = ((a % 1000000007 - b % 1000000007) % 1000000007 + 1000000007) %
      1000000007;
  return c;
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long exgcd(long long x, long long y, long long &a, long long &b) {
  int flag = 0;
  long long t, la = 1, lb = 0, ra = 0, rb = 1;
  while (x % y) {
    if (flag == 0)
      la -= x / y * ra, lb -= x / y * rb;
    else
      ra -= x / y * la, rb -= x / y * lb;
    t = x, x = y, y = t % y;
    flag = 1 - flag;
  }
  if (flag == 0)
    a = ra, b = rb;
  else
    a = la, b = lb;
  return y;
}
long long n, cb;
long long l[10], r[10];
double total;
long long vis[7][3][3];
long long dp[7][3][3];
long long solve(long long pos, long long same, long long boro) {
  long long &ret = dp[pos][same][boro];
  long long &v = vis[pos][same][boro];
  if (v == cb) return ret;
  v = cb;
  if (pos == n + 1) {
    if (same == 2)
      return ret = 1;
    else if (same == 1 && boro == 1)
      return ret = 1;
    return ret = 0;
  }
  ret = 0;
  if (l[pos] <= cb && r[pos] >= cb) {
    ret += solve(pos + 1, min(2LL, same + 1LL), boro);
  }
  if (l[pos] < cb) {
    ret += (min(cb - 1, r[pos]) - l[pos] + 1) * solve(pos + 1, same, boro);
  }
  if (cb < r[pos] && boro == 0) {
    ret += (r[pos] - max(l[pos], cb + 1) + 1) * solve(pos + 1, same, boro + 1);
  }
  return ret;
}
int main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) scanf("%lld %lld", &l[i], &r[i]);
  total = 1;
  for (long long i = 1; i <= n; i++) {
    total = (total) * ((double)(r[i] - l[i] + 1));
  }
  double ans = 0;
  for (cb = 1; cb <= 10000; cb++) {
    double now_ans = (((double)solve(1, 0, 0) * (double)cb) / total);
    ans += now_ans;
  }
  printf("%0.9f\n", ans);
  return 0;
}
