#include <bits/stdc++.h>
using namespace std;
vector<vector<double> > V;
struct Chance {
  double best;
  int w;
};
vector<Chance> go(int lo, int hi) {
  if (lo == hi) return {(Chance){1, lo}};
  int m = (lo + hi) / 2;
  vector<Chance> f = go(lo, m);
  vector<Chance> s = go(m + 1, hi);
  vector<Chance> t;
  for (int i = 0; i < f.size(); ++i) {
    double best = 0;
    for (int j = 0; j < s.size(); ++j) {
    }
  }
}
long double mem[64][64][64];
int cat[64][64][64];
long double prob(int lo, int hi, int w) {
  if (lo == hi) return 1;
  if (cat[lo][hi][w]) return mem[lo][hi][w];
  int m = (lo + hi) / 2;
  if (w <= m) {
    long double r = 0;
    for (int j = m + 1; j <= hi; ++j) {
      long double t1 = prob(m + 1, hi, j);
      long double t2 = prob(lo, m, w);
      r += V[w][j] * t1 * t2;
    }
    cat[lo][hi][w] = 1;
    return mem[lo][hi][w] = r;
  } else {
    long double r = 0;
    for (int j = lo; j <= m; ++j) {
      long double t1 = prob(m + 1, hi, w);
      long double t2 = prob(lo, m, j);
      r += V[w][j] * t1 * t2;
    }
    cat[lo][hi][w] = 1;
    return mem[lo][hi][w] = r;
  }
}
long double mem2[64][64][64];
int cat2[64][64][64];
long double bestVal(int lo, int hi, int w) {
  if (lo == hi) return 0;
  if (cat2[lo][hi][w]) return mem2[lo][hi][w];
  int sz = hi - lo + 1;
  assert(sz % 2 == 0);
  int m = (lo + hi) / 2;
  int P = (hi - lo + 1) / 2;
  if (w <= m) {
    long double r = 0, mv = 0;
    long double v1 = bestVal(lo, m, w);
    for (int j = m + 1; j <= hi; ++j) {
      long double v2 = bestVal(m + 1, hi, j);
      long double p1 = prob(lo, m, w);
      long double p2 = prob(m + 1, hi, j);
      r += P * V[w][j] * p1 * p2;
      mv = max(mv, v2);
    }
    cat2[lo][hi][w] = 1;
    return mem2[lo][hi][w] = r + v1 + mv;
  } else {
    long double r = 0, mv = 0;
    long double v2 = bestVal(m + 1, hi, w);
    for (int j = lo; j <= m; ++j) {
      long double v1 = bestVal(lo, m, j);
      long double p1 = prob(lo, m, j);
      long double p2 = prob(m + 1, hi, w);
      r += P * V[w][j] * p1 * p2;
      mv = max(mv, v1);
    }
    cat2[lo][hi][w] = 1;
    return mem2[lo][hi][w] = r + v2 + mv;
  }
}
int main(int argc, char *argv[]) {
  int N;
  cin >> N;
  N = 1 << N;
  V = vector<vector<double> >(N, vector<double>(N));
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      cin >> V[i][j];
      V[i][j] /= 100;
    }
  }
  long double an = 0;
  for (int i = 0; i < N; ++i) {
    an = max(an, bestVal(0, N - 1, i));
  }
  cout << setprecision(15) << fixed << an << endl;
}
