#include <bits/stdc++.h>
using namespace std;
struct comp {
  bool operator()(const pair<pair<int, int>, int>& a,
                  const pair<pair<int, int>, int>& b) {
    return a.first.first > b.first.first;
  }
};
priority_queue<pair<pair<int, int>, int>, vector<pair<pair<int, int>, int>>,
               comp>
    Q;
map<pair<int, int>, int> P;
int N, d;
int V[405];
pair<int, int> T[405];
bool vis[405];
int D[405];
int to(int m) { return m + 100; }
int get(pair<int, int> u, pair<int, int> v) {
  return abs(u.first - v.first) + abs(u.second - v.second);
}
void solve() {
  Q.push(make_pair(make_pair(0, 0), 0));
  while (!Q.empty()) {
    int w = Q.top().first.first;
    int t = Q.top().first.second;
    int v = Q.top().second;
    Q.pop();
    for (int i = 0; i < N; i++) {
      if (i == v || vis[i]) continue;
      int r = w + get(T[v], T[i]) * d;
      r = max(r - t, 0);
      if (r < D[i]) {
        D[i] = r;
        Q.push(make_pair(make_pair(D[i], max(t - r, 0) + V[i]), i));
      }
    }
    vis[v] = 1;
  }
}
int main() {
  int u, v;
  scanf("%d %d", &N, &d);
  for (int i = 1; i < N - 1; i++) scanf("%d", V + i);
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &T[i].first, &T[i].second);
  }
  for (int i = 0; i < N; i++) D[i] = (int)1e9;
  solve();
  printf("%d", D[N - 1]);
}
