Permutation Matrix

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

You are given a positive integer nn. Construct such matrix 2n×2n2^n \times 2^n that:

  • The matrix contains distinct positive integers from 11 to 22n2^{2n}.
  • The sums of elements all each submatrices of size 2n1×2n12^{n-1} \times 2^{n-1} are equal.

A submatrix is a contiguous rectangle of elements in the original matrix.

입력

The first line contains an integer nn (1n101 \le n \le 10).

출력

On the very first line, print "YES" if the answer exists, or "NO" if not.

If the answer exists, print any such matrix on the next 2n2^n lines, with each line containing 2n2^n space-separated integers.