CODECHEF: Run with Rotation (incomplete)

http://www.codechef.com/SEPT14/problems/ROTATION