Problem

2/11

Array rotation

Problem

You are given a two-dimensional array N*M (0 < N, M <= 20). The values ​​of the array elements are entered from the keyboard.
Display the array so that the first row becomes the first column, and so on.
 
Input
The first line specifies the size of the array. N - number of rows, M - number of columns (0 < N, M <= 20)
Followed by N lines of M numbers in each line - elements of a two-dimensional array (each element modulo no more than 50).
 
Output
Display the array so that the first row becomes the first column, and so on.
 
 
Examples
# Input Output
1
2 3
1 2 3
4 5 6
1 4
2 5
3 6