#include <bits/stdc++.h>
volatile bool isLocalTestEnabled = 0;
bool g_isLocalPrintEnabled = (bool)(0);
template <typename T>
void UpdateMin(T& a, const T b) {
  a = std::min(a, b);
}
template <typename T>
void UpdateMax(T& a, const T b) {
  a = std::max(a, b);
}
const long double Pi = std::atan(1.0L) * 4.0L;
static const long double Eps = 1.0e-09;
template <typename T>
bool IsEqual(const T a, const T b) {
  return std::abs(a - b) < Eps;
}
template <typename T>
bool IsGreater(const T a, const T b) {
  return a > b + Eps;
}
template <typename T>
bool IsLess(const T a, const T b) {
  return a + Eps < b;
}
template <typename T>
bool IsGreaterEqual(const T a, const T b) {
  return !IsLess(a, b);
}
template <typename T>
bool IsLessEqual(const T a, const T b) {
  return !IsGreater(a, b);
}
template <typename T>
std::string ToStr(const T& val) {
  std::ostringstream ostr;
  ostr << val;
  return ostr.str();
}
template <typename T>
bool FromStr(const std::string& str, T& val) {
  std::istringstream istr(str);
  istr >> val;
  return !!istr;
}
template <typename T>
std::istream& operator>>(std::istream& ist, std::vector<T>& data) {
  ;
  for (size_t i = 0; i < data.size(); i++) {
    ist >> data[i];
  }
  return ist;
}
template <typename T>
T Read(std::istream& ist) {
  ;
  T val;
  ist >> val;
  return val;
}
template <typename T>
std::ostream& operator<<(std::ostream& ost, const std::vector<T>& data) {
  for (size_t i = 0; i < data.size(); i++) {
    if (i != 0) {
      ost << ' ';
    }
    ost << data[i];
  }
  return ost;
}
template <size_t id>
class StopWatch {};
long double GetBestScore(const size_t r, const size_t groupId,
                         const std::vector<std::vector<long double> >& w);
long double GetBestScoreKnownWinner(
    const size_t r, const size_t groupId, const size_t winnerId,
    const std::vector<std::vector<long double> >& w) {
  const size_t groupSize = 1 << (r + 1);
  const size_t i = winnerId;
  long double x = w[r][i] * (1U << r);
  if (r > 0) {
    const size_t subgroupSize = groupSize / 2;
    const size_t subgropId = (i / subgroupSize);
    const long double dx = GetBestScoreKnownWinner(r - 1, subgropId, i, w);
    x += dx;
  }
  if (r > 0) {
    const size_t subgroupSize = groupSize / 2;
    const size_t subgropId = (i / subgroupSize) ^ 1;
    long double y = GetBestScore(r - 1, subgropId, w);
    x += y;
  }
  return x;
}
long double GetBestScore(const size_t r, const size_t groupId,
                         const std::vector<std::vector<long double> >& w) {
  const size_t groupSize = 1 << (r + 1);
  const size_t minT = groupId * groupSize;
  const size_t maxT = minT + groupSize;
  long double bestAns = 0.0;
  for (size_t i = minT; i < maxT; i++) {
    long double x = w[r][i] * (1U << r);
    if (r > 0) {
      const size_t subgroupSize = groupSize / 2;
      const size_t subgropId = (i / subgroupSize);
      const long double dx = GetBestScoreKnownWinner(r - 1, subgropId, i, w);
      x += dx;
    }
    if (r > 0) {
      const size_t subgroupSize = groupSize / 2;
      const size_t subgropId = (i / subgroupSize) ^ 1;
      const long double y = GetBestScore(r - 1, subgropId, w);
      x += y;
    }
    if (x > bestAns) {
      bestAns = x;
    }
  }
  return bestAns;
}
bool Solve(std::istream& ist, std::ostream& ost, const bool multipleTestMode) {
  StopWatch<1> sw;
  (void)sw;
  size_t n;
  ist >> n;
  if (multipleTestMode && !ist) return false;
  if (!g_isLocalPrintEnabled) {
  } else
    std::cerr << std::endl << "Next test" << std::endl;
  const size_t t = 1U << n;
  std::vector<std::vector<uint32_t> > pi(t, std::vector<uint32_t>(t));
  for (size_t i = 0; i < t; i++) {
    ist >> pi[i];
  }
  std::vector<std::vector<long double> > p(t, std::vector<long double>(t, 0));
  for (size_t i = 0; i < t; i++) {
    for (size_t j = 0; j < t; j++) {
      p[i][j] = 0.01L * pi[i][j];
    }
  }
  std::vector<std::vector<long double> > w(n, std::vector<long double>(t));
  for (size_t i = 0; i < t; i++) {
    long double x = (i % 2 == 0) ? p[i][i + 1] : p[i][i - 1];
    w[0][i] = x;
  }
  for (size_t r = 1; r < n; r++) {
    for (size_t i = 0; i < t; i++) {
      const size_t groupSize = 1 << r;
      const size_t thisGroupId = i / groupSize;
      const size_t oppGroupId = thisGroupId ^ 1;
      const size_t minT = oppGroupId * groupSize;
      const size_t maxT = minT + groupSize;
      long double x = 0.0;
      for (size_t op = minT; op < maxT; op++) {
        x += w[r - 1][op] * p[i][op];
      }
      w[r][i] = w[r - 1][i] * x;
    }
  }
  long double ans = GetBestScore(n - 1, 0, w);
  ost << std::fixed << std::setprecision(12) << ans << std::endl;
  return multipleTestMode;
}
void RunSolve(std::istream& ist, std::ostream& ost) { Solve(ist, ost, false); }
int main(int argc, const char* argv[]) {
  std::ios_base::sync_with_stdio(false);
  if (argc > 1) {
    std::ifstream ifs(argv[1]);
    if (!ifs) {
      std::cout << "File not found: " << argv[1] << std::endl;
      return 1;
    }
    RunSolve(ifs, std::cout);
    return 0;
  }
  RunSolve(std::cin, std::cout);
}
