#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000;
const int Q = 1e9 + 7;
void print(long double x) { printf("%.15f\n", (double)x); }
long double dp[MAX][MAX];
long double p[MAX][MAX];
int a[MAX][MAX];
void build(int i, int L, int R, int score) {
  if (L == R - 1) {
    assert(score == 0);
    p[i][L] = 1;
    return;
  }
  int M = (L + R) / 2;
  build(2 * i + 1, L, M, score / 2);
  build(2 * i + 2, M, R, score / 2);
  for (int l = L; l < M; l++) {
    for (int r = M; r < R; r++) {
      p[i][l] += p[2 * i + 1][l] * p[2 * i + 2][r] * a[l][r] / 100.;
      p[i][r] += p[2 * i + 1][l] * p[2 * i + 2][r] * a[r][l] / 100.;
    }
  }
  for (int l = L; l < M; l++) {
    for (int r = M; r < R; r++) {
      dp[i][l] =
          max(dp[i][l], dp[2 * i + 1][l] + dp[2 * i + 2][r] + p[i][l] * score);
      dp[i][r] =
          max(dp[i][r], dp[2 * i + 1][l] + dp[2 * i + 2][r] + p[i][r] * score);
    }
  }
}
int main() {
  srand(time(NULL));
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  n = (1 << n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  build(0, 0, n, n / 2);
  long double ans = 0;
  for (int i = 0; i < n; i++) {
    ans = max(ans, dp[0][i]);
  }
  print(ans);
  cout << endl;
  return 0;
}
