#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>MX>>MY; cin>>N; FOR(i,N) { cin>>X[i+1]>>Y[i+1]>>W[i+1]; X[i+1]-=MX; Y[i+1]-=MY; TW+=W[i+1]; } N++; FOR(i,N) FOR(j,1<