#include <bits/stdc++.h>
using namespace std;
long double a[500][500];
long double g[500][500];
long double f[500][500];
int n, m;
int hg[20000];
void solve(int x, int l, int r) {
  if (l == r) {
    g[x][l] = 1;
    hg[x] = 1;
    return;
  }
  int mid = (r + l) / 2;
  solve(x * 2, l, mid);
  solve(x * 2 + 1, mid + 1, r);
  hg[x] = (hg[x * 2] * 2);
  for (int j = 1; j <= m; j++)
    for (int k = 1; k <= m; k++)
      if (j != k) {
        g[x][j] += g[x * 2][j] * g[x * 2 + 1][k] * a[j][k];
        g[x][k] += g[x * 2][j] * g[x * 2 + 1][k] * a[k][j];
      }
}
void go(int x, int l, int r) {
  if (l == r) return;
  int mid = (r + l) / 2;
  go(x * 2, l, mid);
  go(x * 2 + 1, mid + 1, r);
  for (int j = 1; j <= m; j++)
    for (int k = 1; k <= m; k++)
      if (j != k) {
        f[x][j] =
            max(f[x][j], (f[x * 2][j] + f[x * 2 + 1][k]) + g[x][j] * hg[x] / 2);
        f[x][k] =
            max(f[x][k], (f[x * 2][j] + f[x * 2 + 1][k]) + g[x][k] * hg[x] / 2);
      }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  m = (1 << n);
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
      a[i][j] /= 100;
    }
  solve(1, 1, m);
  go(1, 1, m);
  long double mx = 0;
  for (int j = 1; j <= m; j++) mx = max(mx, f[1][j]);
  cout.precision(12);
  cout << fixed;
  cout << mx << "\n";
  return 0;
}
