import sys sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = (1 << 63)-1 # md = 10**9+7 md = 998244353 def popcnt(a): return bin(a).count("1") def prob(pa): pp = [[0]*n for _ in range(n)] dp = [0]*(1 << n) dp[0] = 1 for s in range(1 << n): j = popcnt(s) p = -1 for i in range(n): if s >> i & 1: continue if j == n-1: pp[i][j] += dp[s] elif p == -1: dp[s | 1 << i] += dp[s]*pa pp[i][j] += dp[s]*pa p = (1-pa)/(n-j-1) else: dp[s | 1 << i] += dp[s]*p pp[i][j] += dp[s]*p return pp n, pa, pb = SI().split() n = int(n) pa = float(pa) pb = float(pb) aa = sorted(LI()) bb = sorted(LI()) pp = prob(pa) qq = prob(pb) ans = 0 for ai, a in enumerate(aa): for bi, b in enumerate(bb): if a < b: break for p, q in zip(pp[ai], qq[bi]): ans += p*q*(a+b) print(f"{ans:.10f}")