#include <bits/stdc++.h>
using namespace std;
int a[111], x[111], y[111], dp[111];
bool f[111];
int ra(int i, int j) { return (abs(x[i] - x[j]) + abs(y[i] - y[j])); }
int main() {
  int j, i, n, k = 0, t = 0, tmax = 0, d;
  cin >> n >> d;
  for (i = 2; i < n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) cin >> x[i] >> y[i];
  for (i = 2; i <= n; i++) dp[i] = 111111111;
  k = 1;
  while (k != n) {
    f[k] = 1;
    for (i = 2; i <= n; i++) {
      dp[i] = min(dp[i], dp[k] + d * ra(i, k));
    }
    int m = 111111111, nom;
    for (j = 2; j <= n; j++)
      if (!f[j] && dp[j] < m) {
        nom = j;
        m = dp[j];
      }
    tmax = max(dp[nom], tmax);
    k = nom;
    if (n != k) dp[k] -= a[k];
  }
  cout << tmax;
}
