#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(const T &x) {
  return x * x;
}
template <class T>
int popcount(const T &n) {
  return (n == 0) ? 0 : (1 + popcount(n & (n - 1)));
}
template <class T>
void ckmin(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
void ckmax(T &a, const T &b) {
  if (b > a) a = b;
}
int N;
int p[69][69];
double prob[7][69];
double dp[7][69];
vector<int> bracket[7][69];
pair<int, int> other(int id, int a, int b) {
  int mid = (a + b) / 2;
  if (id <= mid)
    return {mid + 1, b};
  else
    return {a, mid};
}
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= (1 << N); i++) {
    for (int j = 1; j <= (1 << N); j++) {
      scanf("%d", &p[i][j]);
    }
  }
  for (int k = 1; k <= N; k++) {
    for (int i = 1; i <= (1 << N); i += (1 << k)) {
      for (int j = i; j < i + (1 << k); j++) {
        for (int l = i; l < i + (1 << k); l++) {
          bracket[k][j].push_back(l);
        }
      }
    }
  }
  for (int i = 1; i <= (1 << N); i++)
    prob[0][i] = 1, bracket[0][i].push_back(i);
  for (int k = 1; k <= N; k++) {
    for (int i = 1; i <= (1 << N); i++) {
      for (int num : bracket[k][i]) {
        prob[k][i] += prob[k - 1][i] * prob[k - 1][num] * 0.01 * p[i][num];
      }
      for (int num : bracket[k - 1][i]) {
        prob[k][i] -= prob[k - 1][i] * prob[k - 1][num] * 0.01 * p[i][num];
      }
    }
  }
  for (int k = 1; k <= N; k++) {
    for (int i = 1; i <= (1 << N); i++) {
      pair<int, int> p = other(i, bracket[k][i][0], bracket[k][i].back());
      for (int j = p.first; j <= p.second; j++) {
        ckmax(dp[k][i],
              (1 << (k - 1)) * prob[k][i] + dp[k - 1][i] + dp[k - 1][j]);
      }
    }
  }
  double res = 0.0;
  for (int i = 1; i <= (1 << N); i++) {
    ckmax(res, dp[N][i]);
  }
  printf("%.12lf\n", res);
  return 0;
}
