#include #define x first #define y second #define endl '\n' #define cin fin #define cout fout using namespace std; ifstream fin("war.in"); ofstream fout("war.out"); void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } const int maxn = 50006; const int maxq = 2500;///! struct Command { int x,y,x2,y2,q; }; vector ans; struct Obekt { int x,y,br,id; }; Obekt kuli[maxn],voinici[maxn],voinici2[maxn]; int order[maxn]; int i,j,p,q,n,m,k,sum,mid,l,r; int nach; long long Dist(int x,int y,int x2,int y2) { long long d = (x-x2)*1ll*(x-x2)+(y-y2)*1ll*(y-y2); return d; } void read() { cin>>n>>m; for(i=1;i<=n;i++) { cin>>voinici[i].x>>voinici[i].y>>voinici[i].br; sum+=voinici[i].br; voinici[i].id=i; } for(i=1;i<=m;i++) { cin>>kuli[i].x>>kuli[i].y>>kuli[i].br; kuli[i].id=i; } } void print() { cout< s; int d = 1; for(i=2;i<=m;i++) s.insert(i); while(!s.empty()) { long long mn = LLONG_MAX; k = -1; int br = 0; for(auto i:s) { if(i==p)continue; long long tek = Dist(kuli[i].x,kuli[i].y,kuli[p].x,kuli[p].y); if(tekmaxq) break; } order[++d] = k; s.erase(k); p = k; } /** for(i=1;i<=m;i++) cout<