AtCoder Grand Contest 027
D
Modulo Matrix
AtCoder
⌀ 2984
原题
← CE →
翻译中…

Problem Statement

翻译中…

You are given an integer $N$.

翻译中…

Construct any one $N$-by-$N$ matrix $a$ that satisfies the conditions below. It can be proved that a solution always exists under the constraints of this problem.

翻译中…
  • $1 \leq a_{i,j} \leq 10^{15}$
  • $a_{i,j}$ are pairwise distinct integers.
  • There exists a positive integer $m$ such that the following holds: Let $x$ and $y$ be two elements of the matrix that are vertically or horizontally adjacent. Then, ${\rm max}(x,y)$ ${\rm mod}$ ${\rm min}(x,y)$ is always $m$.
翻译中…

Constraints

翻译中…
  • $2 \leq N \leq 500$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N

翻译中…

Output

翻译中…

Print your solution in the following format:

翻译中…

a_{1,1} ... a_{1,N}
:
a_{N,1} ... a_{N,N}

翻译中…

样例

Input #1
2
Output #1
4 7
23 10
- For any two elements $x$ and $y$ that are vertically or horizontally adjacent, ${\rm max}(x,y)$ ${\rm mod}$ ${\rm min}(x,y)$ is always $3$.
题目信息
题号
agc027_d
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。