#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
const int maxm = 20005;
const int inf = 1000000000;
struct node {
  int u, v, next;
  int val, cost;
} s[maxm * 2];
int ind;
int p[maxn];
int que[10000000];
char v[maxn];
void init() {
  ind = 0;
  memset(p, -1, sizeof(p));
}
inline void insert(int x, int y, int z, int c) {
  s[ind].cost = c;
  s[ind].u = x;
  s[ind].v = y;
  s[ind].val = z;
  s[ind].next = p[x];
  p[x] = ind++;
  s[ind].cost = -c;
  s[ind].u = y;
  s[ind].v = x;
  s[ind].val = 0;
  s[ind].next = p[y];
  p[y] = ind++;
}
int min_cost_max_flow(int n, int source, int sink, int& netcost) {
  int pre[maxn], min[maxn], i, t;
  int ret = 0;
  for (netcost = 0;;) {
    for (i = 0; i < n; i++) pre[i] = -1, min[i] = inf;
    pre[source] = -1;
    min[source] = 0;
    int h = 0, r = 0;
    que[0] = source;
    memset(v, 0, sizeof(v));
    v[source] = 1;
    while (h <= r) {
      t = que[h++];
      v[t] = 0;
      for (i = p[t]; i != -1; i = s[i].next) {
        int to = s[i].v;
        if (s[i].val > 0 && min[t] + s[i].cost < min[to]) {
          min[to] = min[t] + s[i].cost;
          pre[to] = i;
          if (v[to] == 0) {
            v[to] = 1;
            que[++r] = to;
          }
        }
      }
    }
    if (pre[sink] == -1) break;
    t = inf;
    for (i = sink; pre[i] != -1;) {
      if (s[pre[i]].val < t) t = s[pre[i]].val;
      i = s[pre[i]].u;
    }
    netcost += min[sink] * t;
    ret += t;
    for (i = sink; pre[i] != -1;) {
      s[pre[i]].val -= t;
      s[pre[i] ^ 1].val += t;
      i = s[pre[i]].u;
    }
  }
  return ret;
}
int main() {
  int n, d;
  int a[105], x[105], y[105];
  while (cin >> n >> d) {
    for (int i = 1; i < n - 1; i++) cin >> a[i];
    a[0] = a[n - 1] = 0;
    for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
    init();
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) {
        if (i == j) continue;
        int dist = abs(x[j] - x[i]) + abs(y[j] - y[i]);
        insert(i, j, 1, d * dist - a[i]);
      }
    insert(n, 0, 1, 0);
    int res;
    min_cost_max_flow(n + 1, n, n - 1, res);
    cout << res << '\n';
  }
  return 0;
}
