|
||||||||||
Stars CoupleTime 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
Sample Output
Hint Hint Author DYGG Source | ||||||||||
|