#include <bits/stdc++.h>
using namespace std;
int X[105], Y[105], A[105], P[105];
int n, d;
struct Edge {
  int u, v, d;
  Edge() {}
  Edge(int a, int b, int c) { u = a, v = b, d = c; }
};
Edge E[105 * 105];
int main() {
  cin >> n >> d;
  for (int i = 2; i <= n - 1; i++) cin >> A[i];
  for (int i = 1; i <= n; i++) cin >> X[i] >> Y[i];
  int m = 0;
  for (int i = 1; i <= n; i++) P[i] = -1 << 29;
  P[1] = 0;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      int dist = abs(X[i] - X[j]) + abs(Y[i] - Y[j]);
      E[m++] = Edge(i, j, dist);
      E[m++] = Edge(j, i, dist);
    }
  for (int i = 0; i < n - 1; i++)
    for (int j = 0; j < m; j++) {
      if (P[E[j].u] > -1 << 29) {
        P[E[j].v] =
            max(P[E[j].v], min(P[E[j].u], P[E[j].u] + A[E[j].u] - E[j].d * d));
      }
    }
  cout << max(0, -1 * P[n]) << endl;
}
