#P6450. [COCI 2008/2009 #4] ROT
[COCI 2008/2009 #4] ROT
Description
Given a character table of size , output the state of this table after rotating it clockwise by degrees.
It is guaranteed that is a multiple of .
Input Format
The first line contains two integers , representing the number of rows and columns of the table.
The next lines each contain characters, representing the initial arrangement of the character table.
The next line contains an integer , representing the clockwise rotation angle.
Output Format
Output the final state of the table after rotation.
3 5
damir
marko
darko
45
d
m a
d a m
a r i
r k r
k o
o
3 5
damir
marko
darko
90
dmd
aaa
rrm
kki
oor
5 5
abcde
bcdef
cdefg
defgh
efghi
315
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
Hint
Constraints
For of the testdata, .
Notes
This problem is translated from COCI2008-2009 CONTEST #4 T3 ROT。
Translated by ChatGPT 5
京公网安备 11011102002149号