#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1.0);
long long a[105][105], b[105], dist[105];
int x[105], y[105], n, visit[105];
void dijkstra(int s) {
  int k = n - 1, flag;
  long long minv;
  for (int i = 0; i < n; i++) dist[i] = a[s][i];
  visit[s] = 1;
  dist[s] = 0;
  while (k--) {
    minv = 1000000000000;
    for (int i = 0; i < n; i++) {
      if (!visit[i]) {
        if (dist[i] > dist[s] + a[s][i]) dist[i] = dist[s] + a[s][i];
        if (dist[i] < minv) {
          minv = dist[i];
          flag = i;
        }
      }
    }
    visit[flag] = 1;
    s = flag;
  }
}
int main() {
  long long d;
  scanf("%d %lld", &n, &d);
  memset(b, 0, sizeof(b));
  memset(visit, 0, sizeof(visit));
  for (int i = 0; i < n; i++) {
    dist[i] = 1000000000000;
    for (int j = 0; j < n; j++) a[i][j] = 1000000000000;
  }
  for (int i = 1; i <= n - 2; i++) scanf("%lld", &b[i]);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    for (int j = 0; j < i; j++) {
      a[i][j] = a[j][i] = d * (abs(x[i] - x[j]) + abs(y[i] - y[j]));
      a[i][j] -= b[i];
      a[j][i] -= b[j];
    }
  }
  dijkstra(0);
  printf("%lld\n", dist[n - 1]);
  return 0;
}
