#include <bits/stdc++.h>
using namespace std;
const int N = 6 + 1;
int n, table[1 << N][1 << N];
long double e[N + 10][1 << N], prob[N + 10][1 << N];
void solve(int p, int l, int r, int point) {
  if (l == r) {
    prob[p][l] = 1;
    e[p][l] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  solve(p + 1, l, mid, point >> 1);
  solve(p + 1, mid + 1, r, point >> 1);
  for (int i = (l), _i = (mid + 1); i < _i; ++i) {
    prob[p][i] = 0;
    for (int j = (mid + 1), _j = (r + 1); j < _j; ++j) {
      prob[p][i] += prob[p + 1][i] * prob[p + 1][j] * table[i][j] / 100.0;
    }
  }
  for (int i = (mid + 1), _i = (r + 1); i < _i; ++i) {
    prob[p][i] = 0;
    for (int j = (l), _j = (mid + 1); j < _j; ++j) {
      prob[p][i] += prob[p + 1][i] * prob[p + 1][j] * table[i][j] / 100.0;
    }
  }
  for (int i = (l), _i = (mid + 1); i < _i; ++i) {
    for (int j = (mid + 1), _j = (r + 1); j < _j; ++j) {
      e[p][i] = max(e[p][i], e[p + 1][i] + e[p + 1][j] + (point * prob[p][i]));
    }
  }
  for (int i = (mid + 1), _i = (r + 1); i < _i; ++i) {
    for (int j = (l), _j = (mid + 1); j < _j; ++j) {
      e[p][i] = max(e[p][i], e[p + 1][i] + e[p + 1][j] + (point * prob[p][i]));
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0, _i = (1 << n); i < _i; ++i) {
    for (int j = 0, _j = (1 << n); j < _j; ++j) {
      cin >> table[i + 1][j + 1];
    }
  }
  for (int i = 0, _i = (N + 10); i < _i; ++i)
    for (int j = 0, _j = (1 << N); j < _j; ++j) e[i][j] = 0;
  solve(0, 1, (1 << n), 1 << (n - 1));
  cout << fixed << setprecision(11)
       << *max_element(e[0] + 1, e[0] + (1 << n) + 1) << endl;
}
