#include <bits/stdc++.h>
using namespace std;
int n, m, k;
long long w[20];
int mark[20][20];
long long dp[20][300000];
long long f(int prev, int mask, int left) {
  if (left == m) {
    return 0;
  }
  if (dp[prev][mask] != -1) {
    return dp[prev][mask];
  }
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    if (mask & (1 << (i - 1))) {
      continue;
    }
    sum =
        max(sum, f(i, mask | (1 << (i - 1)), left + 1) + mark[prev][i] + w[i]);
  }
  dp[prev][mask] = sum;
  return sum;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  memset(dp, -1, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    cin >> w[i];
  }
  for (int i = 0; i < k; i++) {
    int x, y;
    long long c;
    cin >> x >> y >> c;
    mark[x][y] = c;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, f(i, (1 << (i - 1)), 1) + w[i]);
  }
  cout << ans << endl;
}
