Rotate

To confuse his pursuers, Neo has invented a way to rotate the Matrix. However, Neo can only rotate the Matrix 90^\circ, 180^\circ, or 270^\circ. Help Neo compute a given rotation of the Matrix.

Input

The input consists of several test cases. Each test case starts with the number of rows 1n1001\leq n\leq 100 and the number of columns 1m1001\leq m\leq 100 of the Matrix, as well as the number of degrees dd that Neo wants to rotate the Matrix. This is followed by nn rows with mm integers each.

Output

For each test case, the matrix that results from rotating the Matrix dd degrees.

Problem information

Author: Anders Jonsson

Generation: 2026-01-25T13:35:01.330Z

© Jutge.org, 2006–2026.
https://jutge.org