import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num = scanner.nextInt();
int x = scanner.nextInt();
int y = scanner.nextInt();
List<CheckPoint> pointList = new ArrayList<>();
int no = 1;
for(int i = 0; i < num; i++){
int x1 = scanner.nextInt();
int y1 = scanner.nextInt();
CheckPoint tmp = new CheckPoint(x1,y1,no++);
pointList.add(tmp);
}
for(CheckPoint checkPoint : pointList){
checkPoint.distance = checkPoint.getDistance(x,y);
}
Collections.sort(pointList);
int count = 0;
for(CheckPoint checkPoint : pointList){
if(count >= 3){
break;
}
System.out.println(checkPoint.no);
count++;
}
}
}
class CheckPoint implements Comparable<CheckPoint>{
int x;
int y;
int no;
double distance;
public CheckPoint(int x, int y, int no) {
this.x = x;
this.y = y;
this.no = no;
}
public double getDistance(int x, int y){
return Math.sqrt(Math.pow(this.x - x,2) + Math.pow(this.y - y, 2));
}
@Override
public int compareTo(CheckPoint o) {
if(this.distance - o.distance > 0){
return 1;
}
else if(this.distance - o.distance < 0)
{
return -1;
}
else {
return this.no - o.no;
}
}
}
ccf202009-1称检测点查询
于 2024-05-09 13:16:38 首次发布