Editorial for COCI '08 Contest 4 #3 Rot


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Rotating by 90 degrees is not hard, we just need to figure out the formula to move elements: element (y, x) in the rotated table was element (C-x+1, y) in the original table.

With this we can rotate the table by 90 degrees until the sum of angles we rotated by is equal to K, or so that we need another rotation by 45 degrees.

Rotating by 45 degrees requires careful formatting of output, so that it looks slanted as in the examples.


Comments

There are no comments at the moment.