HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Fyodor Menshikov. Training > problem:


02F. 50647 - Spiral

Guest
• Review clarifications (1)

Volume problems

• 01D. 50660 - Triangle and the point
• 01E. 50661 - nth Power of a Digit
• 01F. 50620 - Poker
• 02A. 50662 - Prime numbers (2)
• 02B. 50625 - Permutations
• 02C. 50626 - The route
• 02D. 50667 - Intersecting Line Seg...
• 02E. 50607 - Long sum
• 02F. 50647 - Spiral
• 03A. 50633 - The prime factors
• 03B. 50720 - Permutations (2)
• 03C. 50615 - Moneybox
• 03D. 50666 - The card and envelope
• 03E. 50606 - Long product
• 03F. 50616 - Snake
• 04A. 50634 - Perfect numbers
• 04B. 50635 - Decomposition into terms

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.
Автор: Фёдор Меньшиков, ВГПУ.

Display box consisting of NxN cells filled with numbers from 1 to N2 spiral (see examples).

Input
The first line contains a single number N where 2 < N < 100.
Output
Show N numbers in N lines, separated by spaces. It's not allowed to start in a different helix, except for the upper left corner. Spiral spinning counter-clockwise.

Input 1 Input 2 Input 3
3
4
5
Output 1 Output 2 Output 3
1 2 3
8 9 4
7 6 5
 1  2  3  4
12 13 14  5
11 16 15  6
10  9  8  7
 1  2  3  4  5
16 17 18 19  6
15 24 25 20  7
14 23 22 21  8
13 12 11 10  9

Для отправки решений необходимо выполнить вход.

www.contester.ru