#include <bits/stdc++.h>
using namespace std;
long m, n, k, cnt;
long long res, a[20], c[20][20], dp[265000][20];
long long Max(long long x, long long y) { return (x > y) ? x : y; }
long getBit(long state, long k) { return (state >> k & 1); }
long setBit(long state, long k) { return state | (1 << k); }
long clearBit(long state, long k) { return state & ~(1 << k); }
long toggleBit(long state, long k) { return state ^ (1 << k); }
void DP() {
  long state, tmp, cnt = 0;
  for (long i = 2; i <= (1 << n) - 1; ++i)
    for (long j = 1; j <= n; ++j)
      if (!dp[i][j] && getBit(i, j - 1)) {
        cnt = 1;
        state = clearBit(i, j - 1);
        for (long k = 1; k <= n; ++k)
          if (getBit(state, k - 1)) {
            ++cnt;
            dp[i][j] = Max(dp[i][j], dp[state][k] + c[k][j] + a[j]);
          }
        if (cnt == m) res = Max(res, dp[i][j]);
      }
}
int main() {
  scanf("%ld%ld%ld", &n, &m, &k);
  for (long i = 1; i <= n; ++i) {
    scanf("%I64d", &a[i]);
    dp[1 << (i - 1)][i] = a[i];
    if (m == 1) res = Max(res, a[i]);
  }
  long u, v;
  long long x;
  for (long i = 1; i <= k; ++i) {
    scanf("%ld%ld%I64d", &u, &v, &x);
    c[u][v] = x;
  }
  DP();
  printf("%I64d", res);
  return 0;
}
