#include <bits/stdc++.h>
using namespace std;
int n, d, D[103][103], dist[103][103], a[103], x[103], y[103];
int main() {
  cin >> n >> d;
  memset(a, 0, sizeof a);
  memset(D, 0, sizeof D);
  for (int i = 2; i <= n - 1; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      D[i][j] =
          (i == j ? 0 : (d * (abs(x[i] - x[j]) + abs(y[i] - y[j])) - a[i]));
      dist[i][j] = D[i][j];
    }
  }
  for (int k = 1; k <= n; k++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
      }
    }
  }
  cout << dist[1][n] << endl;
}
