#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
  node() {}
  node(int a, int b) {
    x = a;
    y = b;
  }
};
struct PAIR {
  int u;
  long long cost;
  PAIR() {}
  PAIR(int a, long long b) {
    u = a;
    cost = b;
  }
};
node point[1010];
long long dist[110][110];
int weight[110];
vector<int> v[1010];
int n, d;
int vis[1010];
bool operator<(PAIR a, PAIR b) { return a.cost > b.cost; }
int main() {
  while (scanf("%d%d", &n, &d) != EOF) {
    weight[0] = 0;
    weight[n - 1] = 0;
    for (int i = 0; i < n; i++) v[i].clear();
    memset(vis, 0, sizeof(vis));
    for (int i = 1; i < n - 1; i++) scanf("%d", &weight[i]);
    for (int i = 0; i < n; i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      point[i] = node(x, y);
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        int temp = abs(point[i].x - point[j].x) + abs(point[i].y - point[j].y);
        dist[i][j] = dist[j][i] = temp;
      }
    }
    priority_queue<PAIR> q;
    q.push(PAIR(0, 0));
    long long maxx = 0;
    while (!q.empty()) {
      PAIR temp = q.top();
      q.pop();
      if (vis[temp.u]) continue;
      vis[temp.u] = 1;
      if (temp.cost > maxx) maxx = temp.cost;
      if (temp.u == n - 1) break;
      for (int i = 0; i < n; i++) {
        if (!vis[i]) {
          q.push(PAIR(i, temp.cost + dist[temp.u][i] * d - weight[temp.u]));
        }
      }
    }
    printf("%I64d\n", maxx);
  }
}
