#include <bits/stdc++.h>
using namespace std;
double DP[7][100];
int N;
double mat[100][100];
double P[10][100];
double fP(int lvl, int win, int L, int R) {
  if (lvl == 0) return 1;
  if (P[lvl][win] > -0.5) return P[lvl][win];
  int mi = (L + R) / 2;
  double auxw, aux, ans = 0;
  if (win < mi) {
    auxw = fP(lvl - 1, win, L, mi);
    for (int new_win = (mi); new_win < (R); new_win++) {
      ans += (auxw * fP(lvl - 1, new_win, mi, R) * mat[win][new_win]);
    }
  } else {
    auxw = fP(lvl - 1, win, mi, R);
    for (int new_win = (L); new_win < (mi); new_win++) {
      ans += (auxw * fP(lvl - 1, new_win, L, mi) * mat[win][new_win]);
    }
  }
  return P[lvl][win] = ans;
}
double fDP(int lvl, int pre, int L, int R) {
  if (lvl == 0) return 0;
  if (DP[lvl][pre] > -0.5) return DP[lvl][pre];
  int mi = (L + R) / 2;
  double pts = 1 << (lvl - 1);
  double auxw, aux, ans = 0;
  if (pre < mi) {
    auxw = fDP(lvl - 1, pre, L, mi);
    for (int new_pre = (mi); new_pre < (R); new_pre++) {
      ans = max(ans,
                auxw + fDP(lvl - 1, new_pre, mi, R) + pts * fP(lvl, pre, L, R));
    }
  } else {
    auxw = fDP(lvl - 1, pre, mi, R);
    for (int new_pre = (L); new_pre < (mi); new_pre++) {
      ans = max(ans,
                auxw + fDP(lvl - 1, new_pre, L, mi) + pts * fP(lvl, pre, L, R));
    }
  }
  return DP[lvl][pre] = ans;
}
int main() {
  cin >> N;
  for (int i = (0); i < (7); i++)
    for (int j = (0); j < (100); j++) DP[i][j] = -1;
  for (int i = (0); i < (7); i++)
    for (int j = (0); j < (100); j++) P[i][j] = -1;
  for (int i = (0); i < (1 << N); i++)
    for (int j = (0); j < (1 << N); j++) cin >> mat[i][j];
  for (int i = (0); i < (1 << N); i++)
    for (int j = (0); j < (1 << N); j++) mat[i][j] /= 100.0;
  double ans = 0;
  for (int i = (0); i < ((1 << N)); i++) ans = max(ans, fDP(N, i, 0, 1 << N));
  printf("%.9lf\n", ans);
}
