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

Stars Couple

Time Limit: 1000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1202    Accepted Submission(s): 260


Problem Description
Can you believe it? After Gardon had solved the problem, Angel accepted him! They were sitting on the lawn, watching the stars.
"I still can't believe this!" Gardon said.
Angel smiled and said: "The reason why I love you does not rest on of who you are, but on who I am when I am with you."
Gardon answered :"In my view, it's not because I'm lonely and it's not because it's the Valentine's Day. It's because when you realize you want to spend the rest of your life with somebody, you want the rest of your life to start as soon as possible!"
"Watch the stars! How beautiful!"
"Just like your eyes!" Gardon replied.
Angel smiled again:" Did you hear about this: one star means one person. When two people fall in love, their stars will be always nearby."
"So we are the nearest couple?"
Now there is the question. Can you point out which couple of stars is nearest? Besides, can you fingle out which couple are most distant?
 

Input
Input contains serveral test cases. Each cases starts with a integer N (2<=N<=50,000). Then N lines follow. Each line have two integers Xi and Yi(-10^9<Xi,Yi<10^9), which show the position of one star.
The input will be ended with a integer 0.
 

Output
For each case, print the distance of the nearest couple and the most distant couple.
Print a blank line after each case.
 

Sample Input
3 1 1 0 0 0 1 0
 

Sample Output
Case 1: Distance of the nearest couple is 1.000 Distance of the most distant couple is 1.414 Please use scanf instead of cin.
 

Hint
Hint
 

Author
DYGG
 

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-11-22 10:32:35, Gzip enabled