#include <bits/stdc++.h>
using namespace std;
vector<long long> val[130];
long long m, n, i, j;
double a[65][65], dp[130][65][10], p[130][65][10] = {0}, ans = 0;
void gen(long long node, long long h) {
  if (h == m) {
    val[node].push_back(node - n + 1);
    return;
  }
  gen(2 * node + 1, h + 1);
  gen(2 * node + 2, h + 1);
  val[node] = val[2 * node + 1];
  val[node].insert(val[node].end(), val[2 * node + 2].begin(),
                   val[2 * node + 2].end());
}
void sol(long long node, long long first, long long h) {
  long long i;
  if (dp[node][first][h] >= 0) return;
  if (h == m) {
    dp[node][first][h] = 0;
    p[node][first][h] = 1;
    return;
  }
  double score = (1 << (m - h - 1)), t, cur = 0, tt = 0;
  if (val[2 * node + 1].back() >= first) {
    sol(2 * node + 1, first, h + 1);
    for (i = 0; i < val[2 * node + 2].size(); ++i) {
      sol(2 * node + 2, val[2 * node + 2][i], h + 1);
      t = p[2 * node + 1][first][h + 1] *
          p[2 * node + 2][val[2 * node + 2][i]][h + 1] *
          a[first][val[2 * node + 2][i]] / 100;
      cur = max(cur, dp[2 * node + 2][val[2 * node + 2][i]][h + 1] +
                         dp[2 * node + 1][first][h + 1]);
      tt += t * score;
      p[node][first][h] += t;
    }
  } else {
    sol(2 * node + 2, first, h + 1);
    for (i = 0; i < val[2 * node + 1].size(); ++i) {
      sol(2 * node + 1, val[2 * node + 1][i], h + 1);
      t = p[2 * node + 2][first][h + 1] *
          p[2 * node + 1][val[2 * node + 1][i]][h + 1] *
          a[first][val[2 * node + 1][i]] / 100;
      cur = max(cur, dp[2 * node + 1][val[2 * node + 1][i]][h + 1] +
                         dp[2 * node + 2][first][h + 1]);
      tt += t * score;
      p[node][first][h] += t;
    }
  }
  dp[node][first][h] = cur + tt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(10);
  cin >> m;
  n = (1 << m);
  for (i = 0; i < n; ++i)
    for (j = 0; j < n; ++j) cin >> a[i][j];
  gen(0, 0);
  memset(dp, -1, sizeof dp);
  for (i = 0; i < n; ++i) {
    sol(0, i, 0);
    ans = max(ans, dp[0][i][0]);
  }
  cout << ans;
  return 0;
}
