#include using namespace std; const long long INF = 1000000000000; int main(){ int N, M, K; cin >> N >> M >> K; vector A(N); for (int i = 0; i < N; i++){ cin >> A[i]; } vector> E(N, vector(N, INF)); for (int i = 0; i < M; i++){ int X, Y, Z; cin >> X >> Y >> Z; X--; Y--; E[X][Y] = Z; E[Y][X] = Z; } for (int i = 0; i < N; i++){ for (int j = 0; j < N; j++){ for (int k = 0; k < N; k++){ E[j][k] = min(E[j][k], E[j][i] + E[i][k]); } } } vector dp(1 << N, INF); dp[0] = 0; for (int i = 0; i < (1 << N); i++){ for (int j = 0; j < N; j++){ if ((i >> j & 1) == 0){ long long c = A[j]; if (i > 0){ long long mn = INF; for (int k = 0; k < N; k++){ if ((i >> k & 1) == 1){ mn = min(mn, E[j][k]); } } c += mn; } dp[i | (1 << j)] = min(dp[i | (1 << j)], dp[i] + c); } } } long long ans = INF; for (int i = 0; i < (1 << N); i++){ if (__builtin_popcount(i) == K){ ans = min(ans, dp[i]); } } cout << ans << endl; }