#include <bits/stdc++.h>
using namespace std;
const int inv = 1000000000;
const int minv = -inv;
const int max_k = (1 << 6) + 5;
double pr[2 * max_k][max_k];
double dp[2 * max_k][max_k];
int n, k;
double a[max_k][max_k];
void compute(int vt, int l, int r, int s) {
  if (l + 1 == r) {
    pr[vt][l] = 1.0;
    dp[vt][l] = 0.0;
  } else {
    int lc = 2 * vt + 1, rc = 2 * vt + 2;
    int mid = (l + r) / 2;
    compute(lc, l, mid, s / 2);
    compute(rc, mid, r, s / 2);
    for (int i = l; i < r; ++i) {
      dp[vt][i] = 0.0;
      int ic, jc, jl, jr;
      if (i < mid) {
        ic = lc;
        jc = rc;
        jl = mid;
        jr = r;
      } else {
        ic = rc;
        jc = lc;
        jl = l;
        jr = mid;
      }
      pr[vt][i] = 0.0;
      for (int j = jl; j < jr; ++j)
        pr[vt][i] += (pr[ic][i] * pr[jc][j] * a[i][j]);
      for (int j = jl; j < jr; ++j)
        dp[vt][i] =
            max(dp[vt][i], dp[ic][i] + dp[jc][j] + pr[vt][i] * ((double)(s)));
    }
  }
}
int main() {
  scanf("%d", &n);
  k = (1 << n);
  int ia;
  for (int i = 0; i < k; ++i)
    for (int j = 0; j < k; ++j) {
      scanf("%d", &ia);
      a[i][j] = ((double)(ia)) / 100.0;
    }
  compute(0, 0, k, (1 << (n - 1)));
  double res = 0.0;
  for (int i = 0; i < k; ++i) res = max(res, dp[0][i]);
  printf("%.12f\n", res);
  return 0;
}
