#P370. 【例64.1】 二维数组转置
【例64.1】 二维数组转置
Description
Input an array with rows and columns, and output its transpose. Specifically,
the number in the -th row and -th column of the output should be the number in the -th row and -th column of the input.
$1 \le n \le 20000; 1 \le m \le 20000; 1 \le n * m \le 20000; 1 \le a[i][j] \le 1000$
Note: You cannot declare a two-dimensional array with both dimensions of size (arrays cannot be too large, and the size of a two-dimensional array is the product of its dimensions).
A two-dimensional array is essentially equivalent to a one-dimensional array, so you only need a one-dimensional array of size .
Input Format
First line contains two integers and representing the number of rows and columns of the array.
Next lines, each containing integers representing the array contents.
Output Format
First line outputs and . Then output the transpose, consisting of rows and columns. The number in the -th row and -th column should be the number in the -th row and -th column of the input.
Sample
3 2
1 2
3 4
5 62 3
1 3 5
2 4 6