1036: Read data into a matrix

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:106 Solved:56

Description

A matrix is a 2-dimensional array. Write a program to read a list of numbers and store it in a N by N matrix and  show the N by N matrix on screen. The first input is the number N specifying the size of the matrix and the following N*N integers are the elements of the matrix to store in N rows of N elements. (N<=100) For example:
Input:
4 1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7

Output:
1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7

Input

4 1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7

Output

1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7

Sample Input Copy

2 1 2 3 4

Sample Output Copy

1 2
3 4