ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Ad-Hoc > задача:


50406 - Draw Pattern 178

Гость
• Вопросы к жюри (1)

Задачи раздела

• 50302 - Paper Scissors Rock
• 50312 - Sales Bar Chart
• 50313 - Pattern Displays
• 50375 - Area of Circles
• 50393 - Palindromic Numbers
• 50396 - Cinema Tickets - 1
• 50325 - How much time passed?
• 50366 - Student Averages (2 Grades)
• 50406 - Draw Pattern 178
• 50416 - Placing Dominoes on Chess...
• 50477 - Character Pyramids
• 50498 - K-Means
• 50505 - kht Puzzle
• 50346 - The Biggest Date
• 50512 - Coding redundancy
• 50528 - Rock-Scissors-Paper
• 50493 - n-digit kth Prime Number

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Renato Bala.

Draw Pattern 178

Your professor has asked several different pattern questions. And, he has many others waiting for you :) He wants you to draw a pattern as described below:

First you put 4 numbers to the corners of the square, Then you write 4 other numbers next to each corner until finish outer layer of the square. After you finish this layer, you go to the inner layer and you repeat.

Question:
Write a program that gets the size of the pattern and draws the pattern described above.

Input specification
You will be given just one integer number (n) where n is between 1 and 60.

Output specification
Show n2 integer numbers (separated by spaces) as described above.

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


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

www.contester.ru