#include <bits/stdc++.h>
using namespace std;
const int maxn = 110005;
int n, qq, fa[maxn], f[maxn], sz[maxn], up[maxn], edge[maxn], dep[maxn],
    son[maxn], q[maxn];
int tot = 0, V[maxn << 1], N[maxn << 1], F[maxn], ans[maxn];
struct event {
  int c, k, a, b;
} events[maxn << 1];
struct info {
  int ls, rs, len, val;
  info() { ls = 0, rs = 0, len = 0, val = 0; }
} tree[maxn << 2];
bool cmp(event x, event y) {
  if (x.c != y.c) return x.c > y.c;
  return x.k < y.k;
}
void add(int a, int b) { ++tot, V[tot] = b, N[tot] = F[a], F[a] = tot; }
void decompose() {
  int hd = 0, tl = 1;
  memset(son, 0, sizeof son);
  memset(fa, 0, sizeof fa);
  memset(dep, 0, sizeof dep);
  memset(sz, 0, sizeof sz);
  q[1] = 1, dep[1] = 0, fa[1] = 0;
  while (hd != tl) {
    int x = q[++hd];
    for (int p = F[x]; p > 0; p = N[p])
      if (V[p] != fa[x]) {
        q[++tl] = V[p];
        dep[V[p]] = dep[x] + 1;
        fa[V[p]] = x;
      }
  }
  for (int i = n, x; i > 0; i--) {
    sz[x = q[i]]++;
    if (fa[x]) {
      sz[fa[x]] += sz[x];
      if (!son[fa[x]] || sz[x] > sz[son[fa[x]]]) son[fa[x]] = x;
    }
  }
  int num = 0;
  for (int i = n, x, y; i > 0; i--) {
    x = q[i];
    if (son[x]) continue;
    while (fa[x] && son[fa[x]] == x) x = fa[x];
    y = x;
    while (x > 0) up[x] = y, edge[x] = ++num, x = son[x];
  }
}
info rev(info a) {
  swap(a.ls, a.rs);
  return a;
}
info operator+(const info &a, const info &b) {
  info ret;
  ret.len = a.len + b.len;
  ret.ls = a.ls;
  if (a.ls == a.len) ret.ls = a.len + b.ls;
  ret.rs = b.rs;
  if (b.rs == b.len) ret.rs = b.len + a.rs;
  ret.val = a.val + b.val - f[a.rs] - f[b.ls] + f[a.rs + b.ls];
  return ret;
}
void build(int cur, int l, int r) {
  tree[cur].len = r - l + 1;
  tree[cur].val = tree[cur].ls = tree[cur].rs = 0;
  if (l != r)
    build((cur << 1), l, ((l + r) >> 1)),
        build((cur << 1 | 1), ((l + r) >> 1) + 1, r);
}
void modify(int cur, int l, int r, int pos) {
  if (l == r) {
    tree[cur].val = f[1];
    tree[cur].ls = tree[cur].rs = 1;
    return;
  }
  if (pos <= ((l + r) >> 1))
    modify((cur << 1), l, ((l + r) >> 1), pos);
  else
    modify((cur << 1 | 1), ((l + r) >> 1) + 1, r, pos);
  tree[cur] = tree[(cur << 1)] + tree[(cur << 1 | 1)];
}
info query(int cur, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) return tree[cur];
  info ret;
  if (ql <= ((l + r) >> 1))
    ret = ret + query((cur << 1), l, ((l + r) >> 1), ql, qr);
  if (qr > ((l + r) >> 1))
    ret = ret + query((cur << 1 | 1), ((l + r) >> 1) + 1, r, ql, qr);
  return ret;
}
void upd(int a, int b) {
  if (dep[a] < dep[b]) swap(a, b);
  modify(1, 1, n, edge[a]);
}
int ask(int x, int y) {
  info vx, vy;
  while (up[x] != up[y]) {
    if (dep[up[x]] < dep[up[y]]) swap(x, y), swap(vx, vy);
    vx = query(1, 1, n, edge[up[x]], edge[x]) + vx;
    x = fa[up[x]];
  }
  if (dep[x] < dep[y]) swap(x, y), swap(vx, vy);
  info ans = rev(vy) + query(1, 1, n, edge[y] + 1, edge[x]) + vx;
  return ans.val;
}
int main() {
  scanf("%d%d", &n, &qq);
  f[0] = f[n] = 0;
  for (int i = 1; i < n; i++) scanf("%d", &f[i]);
  int all = 0;
  for (int i = 1; i < n; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    add(u, v), add(v, u);
    events[++all] = (event){w, 0, u, v};
  }
  for (int i = 1; i <= qq; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    events[++all] = (event){w, i, u, v};
  }
  sort(events + 1, events + 1 + all, cmp);
  decompose();
  build(1, 1, n);
  for (int i = 1; i <= all; i++)
    if (events[i].k == 0) {
      upd(events[i].a, events[i].b);
    } else {
      ans[events[i].k] = ask(events[i].a, events[i].b);
    }
  for (int i = 1; i <= qq; i++) printf("%d\n", ans[i]);
  return 0;
}
