![](https://i-blog.csdnimg.cn/blog_migrate/4f5a27f1a9a81c030a63c407e6fbb67f.png)
![](https://i-blog.csdnimg.cn/blog_migrate/201f12c78aa6c4da6fe6e727b3504b63.png)
![](https://i-blog.csdnimg.cn/blog_migrate/88541f980c22acbe9a1e718289e64c68.png)
#include <stdio.h>
#include<math.h>
int main()
{
int n,x,y,i,a,b,min=0,k[2009],l;
double e,c[2009];
scanf("%d%d%d",&n,&x,&y);
for(i=1;i<=n;i++){
scanf("%d%d",&a,&b);
e=sqrt((a-x)*(a-x)+(b-y)*(b-y));
c[i]=e;
k[i]=i;//因为最后要输出位置序号
}
for(i=1;i<=n;i++)
for(l=i+1;l<=n;l++){
if(c[l]==c[i])//保证相同时输出最小序号
{
if(k[l]<k[i]){
b=k[l];
k[l]=k[i];
k[i]=b;
}
}
if(c[l]<c[i]){//换数的同时更换坐标
b=c[l];
c[l]=c[i];
c[i]=b;
b=k[l];
k[l]=k[i];
k[i]=b; }}
for(i=1;i<=3;i++){
printf("%d\n",k[i]);
}
return 0;
}