import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int m = sc.nextInt(); int kk = sc.nextInt(); int[] values = new int[n]; long[][] costs = new long[n][n]; for (int i = 0; i < n; i++) { values[i] = sc.nextInt(); Arrays.fill(costs[i], Long.MAX_VALUE / 2); costs[i][i] = 0; } for (int i = 0; i < m; i++) { int a = sc.nextInt() - 1; int b = sc.nextInt() - 1; int c = sc.nextInt(); costs[a][b] = c; costs[b][a] = c; } for (int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { for (int k = 0; k < n; k++) { costs[j][k] = Math.min(costs[j][k], costs[j][i] + costs[i][k]); } } } long[] dp = new long[1 << n]; long min = Long.MAX_VALUE; for (int x = 1; x < (1 << n); x++) { int pop = getPop(x); if (pop == 1) { for (int i = 0; i < n; i++) { if ((x & (1 << i)) != 0) { dp[x] = values[i]; } } if (pop == kk) { min = Math.min(min, dp[x]); } continue; } else if (pop > kk) { continue; } dp[x] = Long.MAX_VALUE; for (int i = 0; i < n; i++) { if ((x & (1 << i)) == 0) { continue; } long distance = Long.MAX_VALUE; for (int j = 0; j < n; j++) { if ((x & (1 << j)) == 0 || i == j) { continue; } distance = Math.min(distance, costs[i][j]); } dp[x] = Math.min(dp[x], dp[x ^ (1 << i)] + values[i] + distance); } if (pop == kk) { min = Math.min(min, dp[x]); } } System.out.println(min); } static int getPop(int x) { int pop = 0; while (x > 0) { pop += x % 2; x >>= 1; } return pop; } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }