Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
N个点中的最长点对
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 28, Accepted users: 25
Problem 11323 : No special judgement
Problem description
  给定N个点,求其距离最长的点对。

Input
  输入有多个案例。每个案例的第一行是一个整数n,2≤n≤1000。随后n+1行,每一行有2个整数,表示点的x、y坐标,-1000≤x、y≤1000。一个单独的0表示输入结束。

Output
  对每一个案例,输出一行。首先输出序号,具体格式见样例。然后输出答案,答案由两个整数组成,分别代表最长点对的序号(序号从0开始,到n结束)。如果存在多个最长点对,输出序号最靠前的一对。Note:冒号后面有一个空格。

Sample Input
4
0 0
1 0
1 1
0 1
0
Sample Output
Case 1: 0 2
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:2271 today,16258998 total, since 2010-05-07