import sequtils,strutils,random,algorithm,math var N : int P : seq[float64] l1 = stdin.readline.split va : int C : array[2, seq[int]] N = l1[0].parseInt P = l1[1..2].map(parsefloat) C[0] = stdin.readline.split.map(parseInt) C[1] = stdin.readline.split.map(parseInt) for i in 0..1: C[i].sort(system.cmp) randomize() proc main : bool= var F : array[2,array[20, bool]] c : array[2, int] cnt : int for n in 1.. c[1]: cnt += c[0] + c[1] else: cnt -= c[0] + c[1] for i in 0..1: for j in 0.. c[1]: cnt += c[0] + c[1] else: cnt -= c[0] + c[1] if cnt > 0: return true for n in 1..100000: if main(): va += 1 echo va / 100000