import sys sys.setrecursionlimit(10 ** 6) def LI(): return list(map(int, sys.stdin.readline().split())) from random import * def main(): def game(xx,yy): sx=sy=0 for _ in range(n-1): m = len(xx) if randrange(1000) < pa: i = m-1 else: i = randrange(m-1) if randrange(1000) < pb: j = m-1 else: j = randrange(m-1) if xx[i]>yy[j]:sx+=xx[i]+yy[j] else:sy+=xx[i]+yy[j] del xx[i] del yy[j] if xx[0]>yy[0]:return sx+xx[0]+yy[0]>sy else:return sx>sy+xx[0]+yy[0] #print(xx,yy,m,i,j) n,pa,pb=input().split() n=int(n) pa=int(pa[2:]) pb=int(pb[2:]) aa=LI() bb=LI() aa.sort(reverse=True) bb.sort(reverse=True) loop=100000 win=0 for _ in range(loop): if game(aa[:],bb[:]):win+=1 print(win/loop) main()