#include <bits/stdc++.h>
using namespace std;
int a[65][65];
double dp[130][70][2], pat, mx[130];
bool maqurast(int x) {
  while (x > 1) {
    if (x % 2 == 1) return 0;
    x /= 2;
  }
  return 1;
}
int main() {
  int n;
  cin >> n;
  int ast = 1;
  for (int i = 0; i < n; i++) ast *= 2;
  for (int i = 1; i <= ast; i++) {
    for (int j = 1; j <= ast; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = ast; i < 2 * ast; i++) {
    dp[i][i - ast + 1][0] = 1;
    dp[i][i - ast + 1][1] = 0;
    mx[i] = 0;
  }
  int hast = 1;
  for (int i = ast - 1; i > 0; i--) {
    int nax1 = 2 * i;
    int nax2 = 2 * i + 1;
    for (int j = 1; j <= ast; j++) {
      for (int k = 1; k <= ast; k++) {
        dp[i][j][0] += dp[nax1][j][0] * dp[nax2][k][0] * 1.0 * a[j][k] / 100;
        dp[i][j][0] += dp[nax2][j][0] * dp[nax1][k][0] * 1.0 * a[j][k] / 100;
      }
    }
  }
  for (int i = ast - 1; i > 0; i--) {
    int nax1 = 2 * i;
    int nax2 = 2 * i + 1;
    for (int j = 1; j <= ast; j++) {
      dp[i][j][1] =
          max(dp[i][j][1], dp[i][j][0] * hast + max(dp[nax1][j][1] + mx[nax2],
                                                    dp[nax2][j][1] + mx[nax1]));
      mx[i] = max(mx[i], dp[i][j][1]);
    }
    if (maqurast(i)) hast *= 2;
  }
  for (int i = 1; i <= ast; i++) pat = max(pat, dp[1][i][1]);
  printf("%.10lf\n", pat);
  return 0;
}
