INF = 10**18 def main(): n, m, k = map(int, input().split()) A = list(map(int, input().split())) g = [[] for i in range(n)] D = [[INF]*n for i in range(n)] for i in range(m): x, y, z = map(int, input().split()) x, y = x-1, y-1 g[x].append((z, y)) g[y].append((z, x)) D[x][y] = z D[y][x] = z for i in range(n): D[i][i] = 0 def warshal_floyd(d): for k in range(n): for i in range(n): for j in range(n): d[i][j] = min(d[i][j], d[i][k]+d[k][j]) return d D = warshal_floyd(D) mn = [[INF]*n for i in range(1<>u)&1: U.append(u) for v in range(n): d = INF for u in U: d = min(d, D[v][u]) mn[s][v] = d dp = [INF]*(1<>v)&1: continue ns = s|(1<