from itertools import permutations from math import factorial n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = 0 for a_ in permutations(a): for b_ in permutations(b): if sum([a_[i] > b[i] for i in range(n)]) > n // 2: ans += 1 print(ans / (factorial(n) ** 2))