def Warshall_Floyd(edges,N): for k in range(N): for i in range(N): for j in range(N): edges[i][j]=min(edges[i][j],edges[i][k]+edges[k][j]) return edges INF=10**18 n,m,K=map(int,input().split()) a=list(map(int,input().split())) edge=[[INF]*n for i in range(n)] for i in range(m): x,y,k=map(int,input().split()) x,y=x-1,y-1 edge[x][y]=k edge[y][x]=k for i in range(n): edge[i][i]=0 dist=Warshall_Floyd(edge,n) dp=[INF]*(1<