quadrants
Problem
Fill the square array with integers as shown. There are zeros on the main and side diagonals, these diagonals divide the array into four parts. Units are written in the upper part, twos are written in the right, threes are written in the bottom, fours are written in the left.
Input
The input is a single number n - the size of a square array (n <= 100).
Imprint
Display the completed square matrix.
Examples
# |
Input |
Output |
1 |
8 |
0 1 1 1 1 1 1 0
4 0 1 1 1 1 0 2
4 4 0 1 1 0 2 2
4 4 4 0 0 2 2 2
4 4 4 0 0 2 2 2
4 4 0 3 3 0 2 2
4 0 3 3 3 3 0 2
0 3 3 3 3 3 3 0
|