Transpose
Print the transpose of the N×M matrix (an M×N matrix).
Input: the first line has N and M; the next N lines each have M integers.
Output: M lines of N integers.
Constraints:
- 1 ≤ N, M ≤ 100
Sample Tests
Input 1
2 3 1 2 3 4 5 6
Output 1
1 4 2 5 3 6
Input 2
1 1 7
Output 2
7
Discussion (opens after you solve — no spoilers before)
No comments yet.