Woburn Challenge 2002 - Suicidal
As Gandalf hit the walls reeling from yet another shot from Saruman's magic staff, he noticed that they moved to a large room, with shiny violet walls. Immediately he knew what had taken place, but it was too late - with one movement of his staff, Saruman had shut the door.
What awaited Gandalf was an old wizard challenge, known as the Klingon
Roulette. Gandalf would be placed in one corner, Saruman in another.
They would shoot a fire ball, one at a time, which would then proceed to
ricochet off the shimmering violet walls. Gandalf felt his power fading,
so he knew his yellow flaming ball would only last about one billion
(
The contest was won when only one man was left standing. Gandalf focused to try to foresee the path of the ball…
Given a rectangular room of dimensions SENILE
.
The fire ball travels at a speed such that 1 unit is traversed in one
life time. The corners are labelled in clockwise manner -
You may also like to know that Gandalf can do this problem using a signed 32-bit integer for his calculations.
Input Specification
Each test case consists of a line with 3 integers -
There will be multiple test cases; the last test case will simply have
Output Specification
Print which corner would be hit first, or SENILE
.
Sample Input
1 1 1
-1 -1 -1
Sample Output
7
Comments