n=input() a=lambda:map(int,raw_input().split()) b,c=a(),a() print sum(d>e for d in b for e in c)/reduce(lambda d,e:d*e,range(1,n+1),1)**2.0