#include <bits/stdc++.h>
using namespace std;
int dist[105];
bool used[105];
int main() {
  int n, d;
  cin >> n >> d;
  vector<int> v(n);
  vector<pair<int, int> > coord(n);
  for (int i = 0; i < n - 2; ++i) {
    cin >> v[i + 1];
  }
  for (int i = 0; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    coord[i] = make_pair(a, b);
  }
  for (int i = 0; i < n; ++i) dist[i] = -2e9;
  dist[0] = 0;
  for (int i = 0; i < n; ++i) {
    int v1 = -1;
    for (int j = 0; j < n; ++j) {
      if (!used[j] && (v1 == -1 || dist[j] > dist[v1])) v1 = j;
    }
    used[v1] = true;
    for (int j = 0; j < n; ++j) {
      if (j == v1) continue;
      int dd = d * (abs(coord[v1].first - coord[j].first) +
                    abs(coord[v1].second - coord[j].second));
      int how = dist[v1] + v[v1] - dd;
      if (how > dist[j]) {
        dist[j] = how;
      }
    }
  }
  if (dist[n - 1] >= 0)
    cout << 0;
  else
    cout << abs(dist[n - 1]);
  return 0;
}
