#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000000 + 7;
const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const long long infl = 10000000000000000;
const int maxn = 1000 + 10;
const int maxm = 1000 + 10;
int in(int &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return -1;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
double win[maxn][maxn];
double e[maxn][maxn];
double p[maxn][maxn];
void dfs(int o, int l, int r) {
  if (l == r) {
    win[o][l] = 1;
    e[o][l] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  dfs(o << 1, l, mid);
  dfs(o << 1 | 1, mid + 1, r);
  for (int i = l; i <= mid; ++i) {
    for (int j = mid + 1; j <= r; ++j) {
      win[o][i] += win[o << 1][i] * win[o << 1 | 1][j] * p[i][j];
    }
  }
  for (int i = l; i <= mid; ++i) {
    for (int j = mid + 1; j <= r; ++j) {
      e[o][i] = max(e[o][i], win[o][i] * (r - l + 1) / 2 + e[o << 1][i] +
                                 e[o << 1 | 1][j]);
    }
  }
  for (int i = mid + 1; i <= r; ++i) {
    for (int j = l; j <= mid; ++j) {
      win[o][i] += win[o << 1 | 1][i] * win[o << 1][j] * p[i][j];
    }
  }
  for (int i = mid + 1; i <= r; ++i) {
    for (int j = l; j <= mid; ++j) {
      e[o][i] = max(e[o][i], win[o][i] * (r - l + 1) / 2 + e[o << 1 | 1][i] +
                                 e[o << 1][j]);
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  n = 1 << n;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) {
      int x;
      scanf("%d", &x);
      p[i][j] = 0.01 * x;
    }
  dfs(1, 1, n);
  double ans = 0;
  for (int i = 1; i <= n; ++i) ans = max(ans, e[1][i]);
  printf("%.10f\n", ans);
  return 0;
}
