eolymp
bolt
Try our new interface for solving problems
Problems

Rotation

Rotation

The array of size $n \times m$ is given. Rotate it $90$ degrees clockwise. \InputFile The first line contains two integers $n$ and $m~(1 \le n, m \le 50)$. Each of the next $n$ lines contains $m$ nonnegative integers, not greater than $10^9$ --- it is the array itself. \OutputFile Print the rotated array in the same format as input.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3 4
1 2 3 4
5 6 7 8
9 10 11 12
Output example #1
4 3
9 5 1
10 6 2
11 7 3
12 8 4