#include <bits/stdc++.h>
using namespace std;
long double mat[1000][1000];
void get(int l, int r, map<int, long double> &mp, map<int, long double> &second,
         int score) {
  if (l == r) {
    mp[l] = 1;
    second[l] = 0;
    return;
  }
  int m = (l + r) >> 1;
  map<int, long double> mp1, mp2, sc1, sc2;
  get(l, m, mp1, sc1, score >> 1);
  get(m + 1, r, mp2, sc2, score >> 1);
  long double m1, m2;
  m1 = m2 = 0.0;
  for (int i = l; i <= m; ++i) {
    for (int j = m + 1; j <= r; ++j) {
      mp[i] += (mp1[i] * mp2[j] * mat[i][j]);
    }
    second[i] = sc1[i] + score * mp[i];
    m1 = max(m1, sc1[i]);
  }
  for (int i = m + 1; i <= r; ++i) {
    for (int j = l; j <= m; ++j) {
      mp[i] += (mp2[i] * mp1[j] * mat[i][j]);
    }
    second[i] = sc2[i] + score * mp[i];
    m2 = max(m2, sc2[i]);
  }
  for (int i = l; i <= m; ++i) second[i] += m2;
  for (int i = m + 1; i <= r; ++i) second[i] += m1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  map<int, long double> mp, second;
  int n, i, j, k, x, y, z;
  cin >> n;
  int lim = 1 << n;
  int score = 1 << (n - 1);
  for (i = 1; i <= lim; ++i)
    for (j = 1; j <= lim; ++j) cin >> mat[i][j], mat[i][j] /= 100.0;
  get(1, lim, mp, second, score);
  long double ans = 0;
  for (auto it : second) ans = max(ans, it.second);
  cout << fixed << setprecision(15) << ans << endl;
  return 0;
}
