import sys readline=sys.stdin.readline read=sys.stdin.read x,y=map(int,readline().split()) N=int(readline()) X,Y,W=[],[],[] for _ in range(N): xx,yy,w=map(float,readline().split()) X.append(xx) Y.append(yy) W.append(w) inf=1<<30 dp=[[inf]*N for bit in range(1<