Problem2372--蛇形填数

2372: 蛇形填数

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

在n×n方阵里填入1,2,3,…,n×n,要求填成蛇形。例如n=4时方阵为: 10 11 12 1 9 16 13 2 8 15 14 3 7 6 5 4 其中,n≤20。

Input

输入n。

Output

输出题述方阵。n行,每行各数之间用一个空格隔开。

Sample Input Copy

4

Sample Output Copy

10 11 12 1
9 16 13 2
8 15 14 3
7 6 5 4

Source/Category