#include <bits/stdc++.h>
using namespace std;
int n;
int x,y;
int cmp(pair<pair<int,int>,int>&a,pair<pair<int,int>,int>&b){
int s1 = (a.first.first - x) * (a.first.first - x) + (a.first.second - y) * (a.first.second - y);
int s2 = (b.first.first - x) * (b.first.first - x) + (b.first.second - y) * (b.first.second - y);
if(s1 == s2)
return a.second < b.second;
else
return s1 < s2;
}
int main() {
cin>>n>>x>>y;
pair<pair<int,int>,int>h[n];
for (int i = 0; i < n; ++i) {
cin>>h[i].first.first>>h[i].first.second;
h[i].second = i + 1;
}
sort(h+0,h+n,cmp);
cout<<h[0].second<<"\n"<<h[1].second<<"\n"<<h[2].second;
return 0;
}
csp称检测点查询
最新推荐文章于 2022-03-24 19:51:08 发布