#include <bits/stdc++.h>
using namespace std;
const int nmax = 3e5 + 5;
int n, m;
bool ok;
bool pe_lant[nmax + 1];
int tata[nmax + 1], c[nmax + 1];
long long s, best;
vector<pair<int, int>> aux, lant;
vector<pair<int, int>> g[nmax + 1];
void dfs(int nod) {
  for (auto i : g[nod]) {
    if (i.first != tata[nod]) {
      tata[i.first] = nod;
      dfs(i.first);
      c[i.first] = i.second;
    }
  }
}
void dfs_sub(int nod, int t, long long h) {
  aux.push_back({s, h});
  for (auto i : g[nod]) {
    if (pe_lant[i.first] == 0 && i.first != t) {
      dfs_sub(i.first, nod, h + i.second);
    }
  }
}
void precalc() {
  cin >> n >> m;
  for (int i = 1; i < n; ++i) {
    int x, y, z;
    cin >> x >> y >> z;
    g[x].push_back({y, z});
    g[y].push_back({x, z});
  }
  dfs(1);
  for (int i = n; i != 0; i = tata[i]) {
    lant.push_back({i, c[i]});
  }
  reverse(lant.begin(), lant.end());
  for (auto i : lant) pe_lant[i.first] = 1;
}
void solve() {
  best = 1LL << 60;
  s = 0;
  long long mx = -1LL << 59;
  for (auto i : lant) {
    s += i.second;
    aux.clear();
    dfs_sub(i.first, 0, 0);
    swap(aux[0], aux.back());
    aux.pop_back();
    if (aux.size() >= 2) {
      ok = 1;
    }
    best = min(best, s - mx);
    if (s != 0) {
      mx = max(mx, s - i.second + 0);
    }
    for (auto j : aux) {
      best = min(best, j.first - j.second - mx);
    }
    for (auto j : aux) {
      mx = max(mx, 1LL * j.first + j.second);
    }
  }
  if (ok == 1) {
    best = 0;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  precalc();
  solve();
  while (m--) {
    int x;
    cin >> x;
    cout << s - max(0LL, best - x) << "\n";
  }
  return 0;
}
