#include <bits/stdc++.h>
using namespace std;
const int oo = 999999999;
const double PI = 3.1415931;
const double eps = 1e-9;
int n;
double dp_prob[400][10], a[400][100], dp[400][10];
int min_bound(int x, int level) {
  x >>= (level - 1);
  x ^= 1;
  x <<= (level - 1);
  return x;
}
int max_bound(int x, int level) {
  return min_bound(x, level) + (1 << (level - 1)) - 1;
}
double prob(int x, int level) {
  if (level == 0) return 1.0000000000;
  double &ret = dp_prob[x][level];
  if (dp_prob[x][level] != -1) return ret;
  ret = 0.0000000000;
  double sum = 0.0000000000;
  for (int i = min_bound(x, level); i <= max_bound(x, level); i++) {
    sum += prob(i, level - 1) * a[x][i] / 100.0000000000;
  }
  return ret = sum * prob(x, level - 1);
}
double mem(int x, int level) {
  if (level == 0) return 0.00000000000;
  double &ret = dp[x][level];
  if (ret != -1) return ret;
  ret = 0.00000000000;
  ret += mem(x, level - 1);
  double sum = 0.0000000000;
  double maxi = 0.0000000000;
  for (int i = min_bound(x, level); i <= max_bound(x, level); i++) {
    sum += prob(i, level - 1) * a[x][i] / 100.0000000000 * (1 << (level - 1));
    maxi = max(maxi, mem(i, level - 1));
  }
  sum *= prob(x, level - 1);
  ret += sum;
  ret += maxi;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 0; i < 300; i++) {
    for (int j = 0; j < 10; j++) {
      dp_prob[i][j] = -1.00000000000;
      dp[i][j] = -1.00000000000;
    }
  }
  cin >> n;
  for (int i = 0; i < (1 << n); i++) {
    for (int j = 0; j < (1 << n); j++) {
      cin >> a[i][j];
    }
  }
  double ans = 0.0;
  for (int i = 0; i < (1 << n); i++) {
    ans = max(ans, mem(i, n));
  }
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
