#include <bits/stdc++.h>
using namespace std;
const int maxn = 130;
int p[maxn][maxn], n;
double f[maxn][1 << 6], g[maxn][1 << 6], ans = 0.0;
inline void getans(int x, int l, int r, int dep) {
  if (l == r) return (void)(f[x][l] = 1.0);
  int mid = (l + r) >> 1;
  getans(x << 1, l, mid, dep - 1);
  getans(x << 1 | 1, mid + 1, r, dep - 1);
  for (int i = l; i <= mid; i++)
    for (int j = mid + 1; j <= r; j++) {
      double cqz = f[x << 1][i] * f[x << 1 | 1][j];
      f[x][i] += 0.01 * p[i][j] * cqz;
      f[x][j] += 0.01 * p[j][i] * cqz;
    }
  for (int i = l; i <= mid; i++)
    for (int j = mid + 1; j <= r; j++) {
      g[x][i] =
          max(g[x][i], g[x << 1][i] + g[x << 1 | 1][j] + f[x][i] * (1 << dep));
      g[x][j] =
          max(g[x][j], g[x << 1][i] + g[x << 1 | 1][j] + f[x][j] * (1 << dep));
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (1 << n); i++)
    for (int j = 0; j < (1 << n); j++) scanf("%d", &p[i][j]);
  getans(1, 0, (1 << n) - 1, n - 1);
  for (int i = 0; i < (1 << n); i++) ans = max(ans, g[1][i]);
  printf("%.10f\n", ans);
  return 0;
}
