#include <bits/stdc++.h>
using namespace std;
const int N = 1003;
int k, n;
double p[N][N], f[N][N], g[N][N], ans;
void dfs(int u, int l, int r) {
  if (l == r) {
    f[u][l] = 0;
    g[u][l] = 1;
    return;
  }
  int M = l + r >> 1;
  dfs(u << 1, l, M);
  dfs(u << 1 | 1, M + 1, r);
  for (int i = 1; i <= M; i++)
    for (int j = M + 1; j <= n; j++)
      g[u][i] += g[u << 1][i] * g[u << 1 | 1][j] * p[i][j];
  for (int i = M + 1; i <= n; i++)
    for (int j = 1; j <= M; j++)
      g[u][i] += g[u << 1 | 1][i] * g[u << 1][j] * p[i][j];
  for (int i = 1; i <= M; i++)
    for (int j = M + 1; j <= n; j++)
      f[u][i] = max(
          f[u][i], g[u][i] * (r - l + 1) / 2 + f[u << 1][i] + f[u << 1 | 1][j]);
  for (int i = M + 1; i <= n; i++)
    for (int j = 1; j <= M; j++)
      f[u][i] = max(
          f[u][i], g[u][i] * (r - l + 1) / 2 + f[u << 1 | 1][i] + f[u << 1][j]);
}
int main() {
  scanf("%d", &k);
  n = 1 << k;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) scanf("%lf", &p[i][j]), p[i][j] /= 100;
  dfs(1, 1, n);
  for (int i = 1; i <= n; i++) ans = max(ans, f[1][i]);
  printf("%.10lf\n", ans);
  return 0;
}
