#include <bits/stdc++.h>
using namespace std;
struct comp {
  bool operator()(int a, int b) { return a > b; }
};
int n, m, satisfaction[18], additional[18][18] = {};
long long dp[262500][18] = {};
long long cur = 0, ans = 0;
void findMaxValue(int bitCount) {
  long long val = cur;
  for (int i = 0; i <= n - 1; i++)
    if ((val & (1LL << i)) != 0) {
      val &= ~(1LL << i);
      if (val == 0)
        dp[cur][i] = satisfaction[i];
      else {
        for (int j = 0; j <= n - 1; j++)
          if ((val & (1LL << j)) != 0) {
            dp[cur][i] = max(dp[cur][i],
                             dp[val][j] + satisfaction[i] + additional[j][i]);
          }
      }
      val |= (1LL << i);
      if (bitCount == m) ans = max(ans, dp[cur][i]);
    }
}
void solve(int idx, int bitCount, int bitNeeded) {
  if (idx == n) {
    if (bitCount == bitNeeded) findMaxValue(bitCount);
  } else {
    if (bitNeeded > bitCount) {
      cur |= (1LL << idx);
      solve(idx + 1, bitCount + 1, bitNeeded);
      cur &= ~(1LL << idx);
    }
    solve(idx + 1, bitCount, bitNeeded);
  }
}
int main() {
  int k, a, b, c;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i <= n - 1; i++) scanf("%d", &satisfaction[i]);
  for (int i = 0; i <= k - 1; i++) {
    scanf("%d %d %d", &a, &b, &c);
    additional[a - 1][b - 1] = c;
  }
  for (int i = 1; i <= m; i++) solve(0, 0, i);
  cout << ans << endl;
  return 0;
}
