#abc237b. B - Matrix Transposition
B - Matrix Transposition
Score : points
问题描述
给定一个 × 的矩阵 。
中从上数第 行、从左数第 列的元素为 。
令 为一个 × 的矩阵,其中从上数第 行、从左数第 列的元素等于 。
即,矩阵 是矩阵 的转置。
输出矩阵 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given an -by- matrix .
The element at the -th row from the top and -th column from the left of is .
Let be a -by- matrix whose element at the -th row from the top and -th column from the left equals .
That is, is the transpose of .
Print .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print in the following format:
Sample Input 1
4 3
1 2 3
4 5 6
7 8 9
10 11 12
Sample Output 1
1 4 7 10
2 5 8 11
3 6 9 12
For example, we have , so the element at the -st row from the top and -nd column from the left of the transpose is .
Sample Input 2
2 2
1000000000 1000000000
1000000000 1000000000
Sample Output 2
1000000000 1000000000
1000000000 1000000000
update @ 2024/3/10 10:15:12