CCC '05 J4 - Cross Spiral


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
C++, Python
8 7 2 2 40

Sample Output 3

7
4

Explanation for Sample Output 3

Same square as Sample Input 2, but after \(40\) steps, we are at column \(7\) , row \(4\) .

Sample Input 4

6
6
1
2
1

Sample Output 4

3
1

Explanation for Sample Output 4

A \(6\) by \(6\) square, with the corners being pieces \(1\) column wide and \(2\) rows high. After one step, we end at column \(3\) , row \(1\) .


Comments

There are no comments at the moment.