#include <bits/stdc++.h>
using namespace std;
long long modpow(long long a, long long b,
                 long long mod = (long long)(1e9 + 7)) {
  if (!b) return 1;
  a %= mod;
  return modpow(a * a % mod, b / 2, mod) * (b & 1 ? a : 1) % mod;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int m, n;
  while (cin >> m) {
    n = 1 << m;
    long double p[n][n];
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) {
        cin >> p[i][j];
        p[i][j] /= 100.0;
      }
    long double dp[m + 1][n], E[m + 1][n];
    for (int i = 0; i < m + 1; i++)
      for (int j = 0; j < n; j++) {
        dp[i][j] = i == 0;
        E[i][j] = 0;
      }
    for (int i = 1; i <= m; i++) {
      int d = (1 << i);
      for (int j = 0; j < n; j++) {
        long double a, b;
        a = b = 0;
        for (int k = 0; k < n; k++) {
          if (k / d == j / d && ((k % d < d / 2) ^ (j % d < d / 2))) {
            dp[i][j] += dp[i - 1][j] * dp[i - 1][k] * p[j][k];
            (a) = max((a), (E[i - 1][k]));
            b += dp[i - 1][j] * dp[i - 1][k] * p[j][k] * (1 << (i - 1));
          }
        }
        E[i][j] = E[i - 1][j] + a + b;
      }
    }
    long double ans = 0;
    for (int i = 0; i < n; i++) (ans) = max((ans), (E[m][i]));
    cout << setprecision(12) << ans << endl;
  }
  return 0;
}
