#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); double x0,y0; cin >> x0 >> y0; int N; cin >> N; vector> XY(N+1); XY.at(0) = {x0,y0}; vector W(N+1); double sumw = 0; for(int i=1; i<=N; i++){ int x,y; double w; cin >> x >> y >> w; XY.at(i) = {x,y},W.at(i) = w,sumw += w; } int n2 = 2<> dp(n2,vector(N+1,1e18)); dp.at(1).at(0) = 0; for(int i=1; i