#include <bits/stdc++.h>
using namespace std;
long double dp[70][70][70], prob[70][70][70];
long double a[70][70];
void calc_dp(int l, int r, int depth) {
  if (l == r - 1) {
    dp[l][r][l] = prob[l][r][l] = a[l][r] / 100.0;
    dp[l][r][r] = prob[l][r][r] = a[r][l] / 100.0;
  } else {
    int mid = (l + r) / 2;
    calc_dp(l, mid, depth / 2);
    calc_dp(mid + 1, r, depth / 2);
    for (int first_winner = l; first_winner <= r; first_winner++) {
      for (int second_winner = l; second_winner <= r; second_winner++) {
        if ((first_winner <= mid && second_winner > mid) ||
            (first_winner > mid && second_winner <= mid)) {
          prob[l][r][first_winner] += prob[l][mid][first_winner] *
                                      prob[mid + 1][r][second_winner] *
                                      (a[first_winner][second_winner] / 100.0);
          prob[l][r][second_winner] += prob[l][mid][first_winner] *
                                       prob[mid + 1][r][second_winner] *
                                       (a[second_winner][first_winner] / 100.0);
        }
      }
    }
    for (int winner = l; winner <= r; winner++) {
      dp[l][r][winner] = prob[l][r][winner] * depth;
      long double before = 0;
      for (int first_winner = l; first_winner <= r; first_winner++) {
        for (int second_winner = l; second_winner <= r; second_winner++) {
          if ((first_winner <= mid && second_winner > mid) ||
              (first_winner > mid && second_winner <= mid)) {
            if (first_winner == winner || second_winner == winner) {
              before = max(before, dp[l][mid][first_winner] +
                                       dp[mid + 1][r][second_winner]);
            }
          }
        }
      }
      dp[l][r][winner] += before;
    }
  }
}
signed main() {
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  for (int i = 1; i <= (1 << n); i++) {
    for (int j = 1; j <= (1 << n); j++) {
      cin >> a[i][j];
    }
  }
  calc_dp(1, (1 << n), (1 << (n - 1)));
  long double ans = 0;
  for (int i = 1; i <= (1 << n); i++) ans = max(ans, dp[1][1 << n][i]);
  cout << ans;
}
