#include using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define rep1(i,n) for(int i=1; i<=(n); i++) #define sz(x) int(x.size()) #define all(x) (x).begin(),(x).end() #define Q2 1000000007 #define Q 998244353 #define lINF LONG_LONG_MAX //ll #define iINF 1e9 //int #define yes "Yes" #define no "No" #define kotae cout<; using pqg=priority_queue,greater>; using vi=vector; using vi2=vector>; using vi3=vector>>; using vl=vector; using vl2=vector>; using vl3=vector>>; using vs=vector; using vp=vector

; using vp2=vector>; void chmax(int &x, int y){ x=max(x,y); return; } void chmin(double &x, double y){ x=min(x,y); return; } void chmaxl(ll &x, ll y){ x=max(x,y); return; } void chminl(ll &x, ll y){ x=min(x,y); return; } struct A{ int x,y; double w; }; int main() { int x,y; cin >> x >> y; int n; cin >> n; vectora(n); rep(i,n) cin >> a[i].x >> a[i].y >> a[i].w; int s=1<> dp(s,vector(n,iINF)); double tot=0; double l=100,r=120; rep(i,n) tot+=a[i].w; rep(i,n) dp[1<>j)&1) continue; double nw=tot; rep(k,n) if((i>>k)&1) nw-=a[k].w; double t=(nw+100)/120; rep(k,n){ //from k if(!(i>>k)&1) continue; double nt=(abs(a[j].x-a[k].x)+abs(a[j].y-a[k].y))*t; chmin (dp[i|(1<