Mummy Madness

Time Limit: 5000ms
Memory Limit: 65536KB
This problem will be judged on HDU. Original ID: 3845
64-bit integer IO format: %I64d      Java class name: Main

Description

During an excursion to the desert at the 2011 ACM-ICPC World Finals, you come across an old Egyptian tomb. Unfortunately, opening the tomb turns out to be a bad idea: all of a sudden, what was just a few moments ago an empty desert has now become a desert crawling with grumpy mummies (you would be grumpy too if you were suddenly awakened after a few thousand years of peaceful sleep).(Fortunately, after solving this problem, you woke up safe and sound in a hotel room in Florida. The enraged mummies had just been a dream.
Or had they?)

Input

The input consists of several test cases. Each test case begins with an integer n (0 <= n <= 10^5) giving the number of mummies in the desert. The following n lines each contain two integers x and y, indicating that there is initially a mummy at coordinates (x, y) of the desert, where x and y are both bounded by 10^6 in absolute value. Your starting position is (0, 0), and no mummy starts at this position.

The last test case is followed by a line containing the number &#1048576;1.

Output

For each test case, display its test case number followed by the maximum number of time steps until you are caught (measured as the total number of turns that you get), or the word “never” if you can avoid capture indefinitely.
Follow the format of the sample output.

Sample Input

4
-3 5
3 4
-6 -2
1 -5
1
0 -1
-1

Sample Output

Case 1: 4
Case 2: never

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .