#include <bits/stdc++.h>
std::vector<std::vector<double>> p;
std::map<int, std::map<int, int>> M1;
std::map<int, std::map<int, double>> ANS1;
std::map<int, std::map<int, std::map<int, int>>> M2;
std::map<int, std::map<int, std::map<int, double>>> ANS2;
double dfs2(int l, int r, int level, int taken);
double dfs1(int l, int r, int level) {
  if (M1[l][r]) {
    return ANS1[l][r];
  }
  double maxp = 0;
  for (int i = l; i < r; i++) {
    maxp = std::max(maxp, dfs2(l, r, level, i));
  }
  return ANS1[l][r] = maxp;
}
double dfs2(int l, int r, int level, int taken) {
  if (M2[l][r][taken]) {
    return ANS2[l][r][taken];
  }
  int m = (l + r) / 2;
  double ans;
  if (level == 0) {
    ans = p[level][taken];
  } else if (taken < m) {
    ans = p[level][taken] * (1 << level) + dfs2(l, m, level - 1, taken) +
          dfs1(m, r, level - 1);
  } else {
    ans = p[level][taken] * (1 << level) + dfs1(l, m, level - 1) +
          dfs2(m, r, level - 1, taken);
  }
  return ANS2[l][r][taken] = ans;
}
int main() {
  int n;
  while (std::cin >> n) {
    std::vector<std::vector<int>> v(1 << n, std::vector<int>(1 << n));
    for (int i = 0; i < 1 << n; i++) {
      for (int j = 0; j < 1 << n; j++) {
        std::cin >> v[i][j];
      }
    }
    p = std::vector<std::vector<double>>(n, std::vector<double>(1 << n, 0));
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < 1 << n; j++) {
        if (i == 0) {
          p[i][j] = v[j][j ^ 1] * 0.01;
        } else {
          for (int k = ((j >> i) ^ 1) << i; k < (((j >> i) ^ 1) + 1) << i;
               k++) {
            p[i][j] += p[i - 1][j] * p[i - 1][k] * v[j][k] * 0.01;
          }
        }
      }
    }
    M1.clear();
    M2.clear();
    std::printf("%.10f\n", dfs1(0, 1 << n, n - 1));
  }
  return 0;
}
