Submit | All submissions | Best solutions | Back to list |
TABROT - Rotations |
Rotate a given R × C table of letters clockwise by a given angle K (in degrees), a multiple of 45.
Input
The first line contains two integers R and C, the number of rows and columns in the table respectively.
The next R lines each contain a string of C lowercase letters. The i'th line represents the i'th row of the table.
The last line contains an integer K, a multiple of 45.
Output
Print the table rotated K degrees clockwise, exactly as shown in the examples. There should not be any trailing whitespace after the last character in a line.
Constraints
0 < R < 12
0 < C < 12
0 <= K <= 360
Example
Input 1: 3 7 pxwdhey sremkev ujnuhhv 90 Output 1: usp jrx new umd hkh hee vvy
Input 2: 1 5 qvydg 45 Output 2: q v y d g
Input 3: 5 5 abcde bcdef cdefg defgh efghi 315 Output 3: e d f c e g b d f h a c e g i b d f h c e g d f e
Added by: | Anil Shanbhag |
Date: | 2013-01-17 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
hide comments
2013-01-22 21:20:56 007: Name stolen
Could you plz help me where my code is failing... It seems correct to me Submission ID: 8560917 |
|
2013-01-21 15:21:57 Ehor Nechiporenko
Nice, easy problem for imagination)) |