#K62062. Matrix Transposition
Matrix Transposition
Matrix Transposition
Given a matrix \( A \) of dimensions \( n \times m \), its transpose \( A^T \) is defined as a matrix of dimensions \( m \times n \) where the element at position \( (i,j) \) in \( A^T \) is equal to the element at position \( (j,i) \) in \( A \). In other words, \( A^T_{ij} = A_{ji} \). Your task is to read an \( n \times m \) matrix from standard input, compute its transpose, and output the resulting \( m \times n \) matrix to standard output.
Note: The input and output are handled via standard streams (stdin and stdout).
inputFormat
The first line contains two integers \( n \) and \( m \) representing the number of rows and columns in the matrix, respectively. The following \( n \) lines contain \( m \) space-separated integers each, representing the rows of the matrix.
outputFormat
Output the transpose of the matrix, which consists of \( m \) lines, each containing \( n \) space-separated integers. No extra spaces or newline characters should be printed.
## sample2 3
1 2 3
4 5 6
1 4
2 5
3 6
</p>