F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Mummy Madness

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 442    Accepted Submission(s): 117


Problem 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
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-18 12:19:35, Gzip enabled