CEN112 Homeworks 2013-2015 |
Start: Dec.15.2013 at 12:00:00 PM
Finish: Dec.15.2013 at 05:00:00 PM
The contest is finished!
• Contest scoreboard
|
Feedback | If you notice incorrect translations in Contester, please let author know.
|
|
Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Автор: Фёдор Меньшиков, ВГПУ.
Snake
Russian
Draw a square from NxN cells filled
with numbers from 1 to N2 in the shape
of "Snake" (see examples below).
Input
The first line contains a single number N.
Output
Print N lines of N numbers, separated by spaces.
It's not allowed beginning snake from another corner
or another direction.
Restrictions
2 ≤ N ≤ 100.
Input 1
|
Input 2
|
Input 3
|
3
|
4
|
5
|
Output 1
|
Output 2
|
Output 3
|
1 2 6
3 5 7
4 8 9
|
1 2 6 7
3 5 8 13
4 9 12 14
10 11 15 16
|
1 2 6 7 15
3 5 8 14 16
4 9 13 17 22
10 12 18 21 23
11 19 20 24 25
|
Для отправки решений необходимо выполнить вход.
|