#include <bits/stdc++.h>
using namespace std;
int n, d, a[110], x[110], y[110], vis[110], cost[110];
int D(int i, int j) { return d * (abs(x[i] - x[j]) + abs(y[i] - y[j])); }
int Solve() {
  int i, v;
  for (i = 0; i <= n; i++) {
    vis[i] = 0;
    cost[i] = 10E8;
  }
  cost[n] = 0;
  v = 0;
  while (v != -1) {
    vis[v] = 1;
    for (i = 1; i <= n; i++)
      if (cost[i] > cost[v] + max(0, D(v, i) - a[i]))
        cost[i] = cost[v] + max(0, D(v, i) - a[i]);
    v = -1;
    for (i = 1; i <= n; i++)
      if (!vis[i] && (v == -1 || cost[i] < cost[v])) v = i;
  }
  return cost[1];
}
int main(void) {
  int i;
  while (scanf("%d %d", &n, &d) != EOF) {
    for (i = 2; i < n; i++) scanf("%d", &a[i]);
    a[1] = 0;
    a[n] = 0;
    for (i = 1; i <= n; i++) scanf("%d %d", &x[i], &y[i]);
    printf("%d\n", Solve());
  }
  return 0;
}
