By Neilor Tonin, URI Brazil
Your work in this program is to read an integer number that is the size of a square matrix (width and height) to be filled as follows: the outer part is filled with 0 in the inner part is filled with 1, the main diagonal is filled with 2, the secondary diagonal is filled with 3 and the central element is 4, as the examples below.
Obs: square with '1' always starts at position size / 3, considering width and height and both begin in 0 (zero).
The input contains a number of test cases and ends with EOF (end of file). Each test case consists of an odd integer number N (5 ≤ N ≤ 101) that is the size of the array. For each test case, print the corresponding array as below. After each test case, print a blank line.
For each test case, print the corresponding array as below. After each test case, print a blank line.
Input Sample | Output Sample |
5 |
20003 |