#include <bits/stdc++.h>
using namespace std;
int x[1000][1000];
double y[1000][10], z[1000][10];
int n;
double mx(double a, double b) { return a > b ? a : b; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= (1 << n); ++i)
    for (int j = 1; j <= (1 << n); ++j) scanf("%d", &x[i][j]);
  for (int i = 1; i <= (1 << n); ++i) y[i][0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= (1 << n); ++j) {
      int a = (j - 1) & ((1 << n) - (1 << i));
      if (!((j - 1) & (1 << (i - 1)))) a |= 1 << (i - 1);
      for (int k = a + 1; k <= a + (1 << (i - 1)); ++k) {
        y[j][i] += y[j][i - 1] * y[k][i - 1] * x[j][k] / 100.0;
      }
      if (i == 1)
        z[j][1] = y[j][1];
      else
        for (int k = a + 1; k <= a + (1 << (i - 1)); ++k)
          z[j][i] =
              mx(z[j][i], y[j][i] * (1 << (i - 1)) + z[j][i - 1] + z[k][i - 1]);
    }
  double a = 0;
  for (int i = 1; i <= (1 << n); ++i) a = mx(a, z[i][n]);
  printf("%.9f\n", a);
  return 0;
}
