#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const long long maxn = 1e5 + 10;
const long long inf = 1e18;
long long a[maxn], x[maxn], y[maxn], n, d, di[maxn];
inline long long dis(long long i, long long j) {
  return abs(x[i] - x[j]) + abs(y[i] - y[j]);
}
struct cmp {
  inline bool operator()(const pair<long long, long long> &a,
                         const pair<long long, long long> b) const {
    return make_pair(-a.first, a.second) < make_pair(-b.first, b.second);
  }
};
set<pair<long long, long long>, cmp> st;
bool mark[maxn];
inline bool can(long long lim) {
  st.clear();
  memset(di, -63, sizeof di);
  di[0] = lim;
  st.insert({lim, 0});
  while (st.size()) {
    pair<long long, long long> state = *st.begin();
    st.erase(state);
    for (long long i = 0; i < n; i++) {
      if (i == state.second) continue;
      long long rem = state.first - dis(state.second, i) * d;
      if (rem + a[i] > di[i] && rem > 0) {
        rem += a[i];
        if (di[i] > 0) st.erase({di[i], i});
        di[i] = rem;
        st.insert({di[i], i});
      }
    }
  }
  return di[n - 1] >= 0;
}
int32_t main() {
  n = in(), d = in();
  for (long long i = 1; i < n - 1; i++) a[i] = in();
  for (long long i = 0; i < n; i++) x[i] = in(), y[i] = in();
  long long low = 0, hi = 1e9;
  while (low + 1 < hi) {
    long long mid = (low + hi) >> 1;
    if (can(mid))
      hi = mid;
    else
      low = mid;
  }
  cout << hi - 1 << endl;
}
