#include <bits/stdc++.h>
using namespace std;
struct Point{
double x,y,dis;
int type;
Point(){
}
Point(double xx,double yy,int typee){
x=xx,y=yy,type=typee;
}
};
double diss(Point a,Point b){
return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
}
vector<Point> v;
void init(){
v.push_back(Point(1.0,2.0,1));
v.push_back(Point(10.0,10.0,2));
v.push_back(Point(5.0,4.0,3));
}
bool cmp(Point a,Point b){
return a.dis<b.dis;
}
Point KNN(Point z,int k){
for (int i = 0; i < v.size();i++){
v[i].dis=diss(v[i],z);
}
sort(v.begin(),v.end(),cmp);
vector<int> a;
for (int i = 0; i < k;i++){
a.push_back(v[i].type);
}
sort(a.begin(),a.end());
map<int,int> mp;
for (int i = 0; i < k;i++){
mp[a[i]]++;
}
map<int,int>::iterator it;
int maxx=0;
for (it=mp.begin();it!=mp.end();it++){
if(maxx<mp[it->first]){
maxx=it->first;
}
}
z.type=maxx;
v.push_back(z);
return z;
}
int main(){
init();
Point z;
printf("请输入坐标x:"); scanf("%lf",&z.x);
printf("请输入坐标y:"); scanf("%lf",&z.y);
Point ans=KNN(z,1);
printf("%d",ans.type);
return 0;
}