import sys import itertools import numpy as np input = sys.stdin.readline def S(): return input().rstrip() def I(): return int(input()) def MI(): return map(int, input().split()) n = I() ac = list(MI()) bc = list(MI()) ans = 0 count = 0 for a in itertools.permutations(ac): for b in itertools.permutations(bc): count += 1 result = np.array(a) - np.array(b) win = np.sum(result > 0) lose = np.sum(result < 0) if win > lose: ans += 1 print(ans / count)