#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
double win[maxn][maxn], e[maxn][maxn], pro[maxn][maxn];
int n, m, x;
void DFS(int p, int l, int r) {
  if (l + 1 == r) {
    win[p][l] = 1, e[p][l] = 0;
  } else {
    int mid = (l + r) / 2;
    DFS(p * 2, l, mid);
    DFS(p * 2 + 1, mid, r);
    for (int i = l; i < mid; i++) {
      for (int j = mid; j < r; j++) {
        win[p][i] += win[p * 2][i] * win[p * 2 + 1][j] * pro[i][j];
      }
    }
    for (int i = l; i < mid; i++) {
      for (int j = mid; j < r; j++) {
        e[p][i] = max(e[p][i],
                      win[p][i] * (r - l) / 2 + e[p * 2][i] + e[p * 2 + 1][j]);
      }
    }
    for (int i = mid; i < r; i++) {
      for (int j = l; j < mid; j++) {
        win[p][i] += win[p * 2 + 1][i] * win[p * 2][j] * pro[i][j];
      }
    }
    for (int i = mid; i < r; i++) {
      for (int j = l; j < mid; j++) {
        e[p][i] = max(e[p][i],
                      win[p][i] * (r - l) / 2 + e[p * 2 + 1][i] + e[p * 2][j]);
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  m = 1 << n;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%d", &x);
      pro[i][j] = 0.01 * x;
    }
  }
  DFS(1, 0, m);
  double maxv = 0;
  for (int i = 0; i < m; i++) maxv = max(maxv, e[1][i]);
  printf("%.10f\n", maxv);
  return 0;
}
