N = int(input()) A = [int(x) for x in input().split()] def encode(scoreboard): return sum(scoreboard[i] * 3 ** i for i in range(N)) def modified(scoreboard, index, player): result = scoreboard[:] result[index] = player return result def decode(id): result = [0] * N for i in range(N): result[i] = id % 3 id //= 3 return result dp = [[-1] * (3 ** N), [1] * (3 ** N)] for k in range(3 ** N - 1, -1, -1): scoreboard = decode(k) options = [i for i in range(N) if scoreboard[i] == 0] if not options: result = sum(A[i] if scoreboard[i] == 1 else -A[i] for i in range(N)) if result > 0: dp[0][k] = dp[1][k] = 1 else: dp[0][k] = dp[1][k] = 0 continue dp[0][k] = 0 for i in options: worst = 1 p = 1 / A[i] pr_success = p * dp[1][encode(modified(scoreboard, i, 1))] for j in options: q = 1 / A[j] pr_opponent_success = (1 - p) * q * dp[0][encode(modified(scoreboard, j, 2))] worst = min(worst, (pr_success + pr_opponent_success) / (1 - (1 - p) * (1 - q))) dp[0][k] = max(dp[0][k], worst) dp[1][k] = 1 for i in options: worst = 0 p = 1 / A[i] pr_success = p * dp[0][encode(modified(scoreboard, i, 2))] for j in options: q = 1 / A[j] pr_opponent_success = (1 - p) * q * dp[1][encode(modified(scoreboard, j, 1))] worst = max(worst, (pr_success + pr_opponent_success) / (1 - (1 - p) * (1 - q))) dp[1][k] = min(dp[1][k], worst) print(f"{dp[0][0]:.10f}")