#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int maxn = 64;
int n;
double win[maxn + 5][maxn + 5];
double dp[maxn + 5][maxn + 5][maxn + 5];
double p[maxn + 5][maxn + 5][maxn + 5];
void work(int l, int r) {
  if (r - l <= 1) {
    p[l][r][l] = 1;
    return;
  }
  int mid = (l + r) >> 1;
  work(l, mid);
  work(mid, r);
  for (int i = (l), i_end_ = (mid); i < i_end_; ++i)
    for (int j = (mid), j_end_ = (r); j < j_end_; ++j) {
      p[l][r][i] += p[l][mid][i] * p[mid][r][j] * win[i][j];
      p[l][r][j] += p[l][mid][i] * p[mid][r][j] * win[j][i];
    }
  for (int i = (l), i_end_ = (mid); i < i_end_; ++i)
    for (int j = (mid), j_end_ = (r); j < j_end_; ++j) {
      chkmax(dp[l][r][i],
             dp[l][mid][i] + dp[mid][r][j] + ((r - l) >> 1) * p[l][r][i]);
      chkmax(dp[l][r][j],
             dp[l][mid][i] + dp[mid][r][j] + ((r - l) >> 1) * p[l][r][j]);
    }
}
int main() {
  scanf("%d", &n), n = 1 << n;
  for (int i = (0), i_end_ = (n); i < i_end_; ++i)
    for (int j = (0), j_end_ = (n); j < j_end_; ++j)
      scanf("%lf", win[i] + j), win[i][j] /= 100;
  memset(dp, 0, sizeof dp);
  memset(p, 0, sizeof p);
  work(0, n);
  double ans = 0;
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) chkmax(ans, dp[0][n][i]);
  printf("%.15f\n", ans);
  return 0;
}
