#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int infi = 1e9 + 7;
const long long infl = 1e18;
inline int readChar();
inline void writeChar(int x);
inline void writeWord(const char *s);
inline void flush();
static const int buf_size = 4096;
inline int getChar() {
  static char buf[buf_size];
  static int len = 0, pos = 0;
  if (pos == len) pos = 0, len = fread(buf, 1, buf_size, stdin);
  if (pos == len) return -1;
  return buf[pos++];
}
inline int readChar() {
  int c = getChar();
  while (c >= 0 && c <= 32) c = getChar();
  return c;
}
inline int readWord(char *bf) {
  char *cur = bf;
  *cur = getChar();
  while (*cur <= 32) *cur = getChar();
  while (*cur > 32) {
    ++cur;
    *cur = getChar();
  }
  return cur - bf;
}
inline int readInt() {
  int s = 1, c = readChar();
  int x = 0;
  if (c == '-') s = -1, c = getChar();
  while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
  return s == 1 ? x : -x;
}
static int write_pos = 0;
static char write_buf[buf_size];
inline void writeChar(int x) {
  if (write_pos == buf_size)
    fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;
  write_buf[write_pos++] = x;
}
inline void flush() {
  if (write_pos) fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;
}
inline void writeInt(long long x) {
  if (x < 0) writeChar('-'), x = -x;
  char s[24];
  int n = 0;
  while (x || !n) s[n++] = '0' + x % 10, x /= 10;
  while (n--) writeChar(s[n]);
}
inline void writeWord(const char *s) {
  while (*s) writeChar(*s++);
}
int cnt_bit(int a) {
  int ans = 0;
  while (a) {
    if (a & 1) ++ans;
    a >>= 1;
  }
  return ans;
}
pair<int, int> ar[10];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> ar[i].first >> ar[i].second;
  double ans = 0;
  for (int mask = 1; mask < (1 << n); ++mask) {
    int l = -infi, r = infi;
    for (int i = 0; i < n; ++i) {
      if (mask & (1 << i)) l = max(l, ar[i].first), r = min(r, ar[i].second);
    }
    for (int cost = l; cost <= r; ++cost) {
      double p = 0;
      for (int top = 0; top < n; ++top) {
        if (mask & (1 << top)) continue;
        if (ar[top].second <= cost) continue;
        double d = min(1.0, (double)(ar[top].second - cost) /
                                (double)(ar[top].second - ar[top].first + 1));
        for (int i = 0; i < n; ++i) {
          if (i == top) continue;
          if (mask & (1 << i)) {
            d /= (double)(ar[i].second - ar[i].first + 1);
            continue;
          }
          if (ar[i].first >= cost)
            d = 0;
          else
            d *= min(1.0, (double)(cost - ar[i].first) /
                              (double)(ar[i].second - ar[i].first + 1));
        }
        p += d;
      }
      ans += p * cost;
    }
  }
  for (int mask = 1; mask < (1 << n); ++mask) {
    if (cnt_bit(mask) < 2) continue;
    int l = -infi, r = infi;
    for (int i = 0; i < n; ++i)
      if (mask & (1 << i)) l = max(l, ar[i].first), r = min(r, ar[i].second);
    for (int cost = l; cost <= r; ++cost) {
      double p = 1;
      for (int i = 0; i < n; ++i) {
        if (mask & (1 << i)) {
          p /= (double)(ar[i].second - ar[i].first + 1);
        } else {
          if (ar[i].first >= cost)
            p = 0;
          else
            p *= min(1.0, (double)(cost - ar[i].first) /
                              (double)(ar[i].second - ar[i].first + 1));
        }
      }
      ans += p * cost;
    }
  }
  cout.precision(20);
  cout << fixed;
  cout << ans;
  return 0;
}
