#include <bits/stdc++.h>
using namespace std;
inline int abs(int x) { return (x > 0) ? x : (-x); }
inline int dis(int x1, int y1, int x2, int y2) {
  return abs(x1 - x2) + abs(y1 - y2);
}
int N, w[200], vis[200], f[200], d, x[200], y[200];
int main() {
  scanf("%d%d", &N, &d);
  for (int i = 2; i < N; ++i) scanf("%d", &w[i]);
  for (int i = 1; i <= N; ++i) scanf("%d%d", &x[i], &y[i]), f[i] = 1000000000;
  queue<int> Q;
  memset(vis, 0, sizeof(vis));
  Q.push(1);
  vis[1] = 1;
  f[1] = 0;
  while (Q.size()) {
    int u = Q.front();
    Q.pop();
    vis[u] = 0;
    for (int i = 1; i <= N; ++i)
      if (u != i && f[u] + dis(x[u], y[u], x[i], y[i]) * d - w[i] < f[i]) {
        f[i] = f[u] + dis(x[u], y[u], x[i], y[i]) * d - w[i];
        if (!vis[i]) vis[i] = 1, Q.push(i);
      }
  }
  printf("%d\n", f[N]);
}
