import time import random n, pa, pb = map(float, input().split()) n = int(n) A = list(map(int, input().split())) B = list(map(int, input().split())) A.sort() B.sort() nume = 0 deno = 0 start = time.time() while time.time() - start < 2.0: score = 0 remA = [True] * n remB = [True] * n for i in range(n): if i == n - 1: WA = [1 if tf else 0 for tf in remA] WB = [1 if tf else 0 for tf in remB] else: pa_ = (1.0 - pa) / (n - i - 1) pb_ = (1.0 - pb) / (n - i - 1) WA = [pa_ if tf else 0 for tf in remA] WB = [pb_ if tf else 0 for tf in remB] WA[remA.index(True)] = pa WB[remB.index(True)] = pb a = random.choices(range(n), WA)[0] b = random.choices(range(n), WB)[0] if A[a] > B[b]: score += A[a] + B[b] else: score -= A[a] + B[b] remA[a] = False remB[b] = False if score > 0: nume += 1 deno += 1 print(nume / deno)