import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines x0, y0=map(float, readline().split()) n=int(readline()) xyw=list(map(float, read().split())) x=xyw[::3] y=xyw[1::3] w=xyw[2::3] ws=sum(w) INF=1e9 dp=[[INF]*(1<t1: dp[k][i^(1<