#include using namespace std; int main(){ double inf=DBL_MAX; int N,x,y; double weight=0; double all; cin>>x>>y>>N; vector X(N),Y(N); vector W(N); for(int i=0;i>X[i]>>Y[i]>>W[i]; X[i]-=x; Y[i]-=y; weight+=W[i]; } all=weight; double temp; vector> dp(N,vector(1<>k)%2==0){ weight+=W[k]; } } if((j>>i)%2==0){ dp[i][j]=0; }else if(dp[i][j]==-1){ temp=inf; cout<>k)%2==1){ temp=min(temp,dp[k][j-(1<