#C12331. Rotate Matrix 90 Degrees Clockwise
Rotate Matrix 90 Degrees Clockwise
Rotate Matrix 90 Degrees Clockwise
You are given an N×N matrix. Your task is to rotate this matrix 90° clockwise and output the resulting matrix.
The input starts with an integer N representing the size of the square matrix, followed by N lines each containing N space-separated integers.
After rotating the matrix, print the resulting matrix with each row on a new line. Each number should be separated by a single space.
The rotation operation can be mathematically represented with the following formula:
$$A_{rotated}[i][j] = A[N-1-j][i]$$
Note: If the matrix is empty (i.e. N = 0), nothing should be output.
inputFormat
The first line contains an integer N, the dimension of the square matrix. The next N lines each contain N space-separated integers representing the matrix rows.
outputFormat
Output the rotated matrix, where each of the N lines contains N space-separated integers. If the matrix is empty, output nothing.
## sample3
1 2 3
4 5 6
7 8 9
7 4 1
8 5 2
9 6 3
</p>