#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000 + 7;
const int N = 60 + 7;
const int M = 10000;
const int multipleTest = 0;
int n;
int a[N][N];
double dp[M][N];
double p[M][N];
map<pair<pair<int, int>, int>, int> st;
int k = 0;
double calc(int l, int r, int w, int point, int depth) {
  auto tmp = make_pair(make_pair(l, r), w);
  auto it = st.find(tmp);
  if (it != st.end()) {
    return dp[it->second][w];
  }
  st[tmp] = k++;
  int cur = st[tmp];
  if (l + 1 == r) {
    dp[cur][w] = p[depth][w] * point;
    return dp[cur][w];
  }
  int h = (l + r) / 2;
  if (w <= h) {
    double mx = 0;
    for (int v = h + 1; v <= r; ++v) {
      mx = max(mx, calc(h + 1, r, v, point >> 1, depth - 1));
    }
    dp[cur][w] =
        mx + p[depth][w] * point + calc(l, h, w, point >> 1, depth - 1);
  } else {
    double mx = 0;
    for (int v = l; v <= h; ++v) {
      mx = max(mx, calc(l, h, v, point >> 1, depth - 1));
    }
    dp[cur][w] =
        mx + p[depth][w] * point + calc(h + 1, r, w, point >> 1, depth - 1);
  }
  return dp[cur][w];
}
bool check[N][N][N][7];
void calcP(int l, int r, int w, int depth) {
  if (check[l][r][w][depth]) return;
  if (l == r) {
    p[depth][w] = 1;
    return;
  }
  int h = (l + r) / 2;
  if (w <= h) {
    calcP(l, h, w, depth - 1);
    p[depth][w] = 0;
    for (int v = h + 1; v <= r; ++v) {
      calcP(h + 1, r, v, depth - 1);
      p[depth][w] += p[depth - 1][w] * p[depth - 1][v] * a[w][v] / 100;
    }
  } else {
    calcP(h + 1, r, w, depth - 1);
    p[depth][w] = 0;
    for (int v = l; v <= h; ++v) {
      calcP(l, h, v, depth - 1);
      p[depth][w] += p[depth - 1][w] * p[depth - 1][v] * a[w][v] / 100;
    }
  }
  check[l][r][w][depth] = true;
}
void solve() {
  cin >> n;
  int m = 1;
  for (int i = (0), _b = (n); i < _b; ++i) m *= 2;
  for (int i = (0), _b = (m); i < _b; ++i) {
    for (int j = (0), _b = (m); j < _b; ++j) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int j = 0; j < m; ++j) calcP(0, m - 1, j, n);
  double res = 0;
  for (int j = (0), _b = (m); j < _b; ++j) {
    double tmp = calc(0, m - 1, j, m >> 1, n);
    res = max(res, tmp);
  }
  printf("%.9lf\n", res);
}
int main() {
  int Test = 1;
  if (multipleTest) {
    cin >> Test;
  }
  for (int i = 0; i < Test; ++i) {
    solve();
  }
}
