import sequtils,strutils,math var N = stdin.readline.parseInt A = stdin.readline.split.map(parseInt) B = stdin.readline.split.map(parseInt) hyou : array[17, array[17, array[5, int]]] hyou[0][0][0] = 1 for i in 0..<(1 shl N): for j in 0..<(1 shl N): var ibit = countBits32(i.int32) jbit = countBits32(j.int32) if ibit != jbit: continue for a in 0.. B[b]: for k in 0.. (N - i): k += hyou[(1 shl N) - 1][(1 shl N) - 1][i] for i in 1..N: p *= i var ans : float64 = k / (p * p) echo ans