import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int m = sc.nextInt(); int length = (1 << m); double[] strengths = new double[length]; for (int i = 0; i < length; i++) { strengths[i] = sc.nextInt(); } double[][] dp = new double[m + 1][length]; Arrays.fill(dp[0], 1); for (int i = 1; i <= m; i++) { for (int j = 0; j < length; j++) { int start = j; start >>= i - 1; if (start % 2 == 0) { start++; } else { start--; } start <<= i - 1; for (int k = start; k < start + (1 << (i - 1)); k++) { dp[i][j] += dp[i - 1][k] * Math.pow(strengths[j], 2) / (Math.pow(strengths[j], 2) + Math.pow(strengths[k], 2)); } dp[i][j] *= dp[i - 1][j]; } } System.out.println(dp[m][0]); } }