#include using namespace std; double dp[1<<14][14]; double weight[1<<14]; int main(){ int sx,sy; cin>>sx>>sy; int n; cin>>n; vector x(n),y(n); vector w(n); for(int i=0;i>x[i]>>y[i]>>w[i]; x.insert(x.begin(),sx); y.insert(y.begin(),sy); w.insert(w.begin(),0.0); n++; int sw=0; for(int i=0;i>j)%2) weight[i]+=w[j]; } weight[i]=sw-weight[i]; } for(int i=0;i<(1<