#include #define rep(i, n) for (lli i = 0; i < (n); i++) #define rrep(i, n) for (lli i = (n)-1; i >= 0; i--) using namespace std; using lli = long long int; double s[2005]; double p(int i, int j) { return s[i] * s[i] / (s[i] * s[i] + s[j] * s[j]); } int main() { int m; cin >> m; double dp[11][1 << 11] = {}; rep(j, 1 << m) { cin >> s[j]; dp[0][j] = 1.0; } rep(j, m) { rep(i, 1 << m) { double pos = 0; rep(l, 1 << j) { int idx = ((i ^ 1 << j) & ~((1 << j) - 1)) + l; pos += p(i, idx) * dp[j][idx]; } pos *= dp[j][i]; dp[j + 1][i] = pos; } } cout << dp[m][0] << endl; }