#C397. Matrix Transposition

    ID: 47455 Type: Default 1000ms 256MiB

Matrix Transposition

Matrix Transposition

Given a rectangular matrix of size (m \times n), your task is to compute its transpose. The transpose of a matrix is obtained by swapping its rows and columns, i.e., the element at row (i) and column (j) becomes the element at row (j) and column (i).

Input is provided via standard input and the output should be written to standard output.

inputFormat

The first line contains two integers (m) and (n), representing the number of rows and columns respectively. This is followed by (m) lines, each containing (n) space-separated integers representing the matrix entries.

outputFormat

Output the transposed matrix. Each line corresponds to a row in the transposed matrix, with its elements separated by a single space.## sample

2 2
1 2
3 4
1 3

2 4

</p>