#include <bits/stdc++.h>
using namespace std;
int n, po;
const int maxn = 70;
double pos[maxn][maxn];
double sround[maxn][10];
double score[maxn][10];
double dp[maxn][maxn][maxn];
bool sel[maxn];
double get(int l, int r, int ch, int dep = po) {
  if (dep == 0) return 0;
  if (dp[l][r][ch] >= 0) return dp[l][r][ch];
  int mid = (l + r) >> 1;
  double &ret = dp[l][r][ch];
  ret = 0;
  double tmp = 0;
  if (ch <= mid) {
    ret = get(l, mid, ch, dep - 1) + score[ch][dep];
    for (int i = mid + 1; i <= r; i++) {
      tmp = max(tmp, get(mid + 1, r, i, dep - 1));
    }
    ret += tmp;
  } else {
    ret = get(mid + 1, r, ch, dep - 1) + score[ch][dep];
    for (int i = l; i <= mid; i++) {
      tmp = max(tmp, get(l, mid, i, dep - 1));
    }
    ret += tmp;
  }
  return ret;
}
int main() {
  cin >> po;
  n = 1 << po;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> pos[i][j];
      pos[i][j] /= 100;
      for (int k = 0; k < n; k++) dp[i][j][k] = -1;
    }
  }
  for (int i = 0; i < n; i++) {
    sround[i][0] = 1;
  }
  for (int i = 1; i <= po; i++) {
    for (int j = 0; j < n; j++) {
      sround[j][i] = sround[j][i - 1];
      int cur = ((j >> (i - 1)) ^ 1) << (i - 1);
      double tmp = 0;
      for (int k = cur; k < cur + (1 << (i - 1)); k++)
        tmp += sround[k][i - 1] * pos[j][k];
      sround[j][i] *= tmp;
    }
  }
  for (int i = 0; i < n; i++) {
    score[i][0] = 0;
    for (int j = 1; j <= po; j++) {
      score[i][j] = sround[i][j] * (1 << (j - 1));
    }
  }
  double ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, get(0, n - 1, i));
  cout.precision(12);
  cout << fixed << ans;
  return 0;
}
