#include <bits/stdc++.h>
using namespace std;
int n, d;
int pos[100][2];
int power[100];
int dis(int i, int j) {
  return abs(pos[i][0] - pos[j][0]) + abs(pos[i][1] - pos[j][1]);
}
int main() {
  cin >> n >> d;
  power[0] = power[n - 1] = 0;
  for (int i = 1; i <= n - 2; i++) cin >> power[i];
  for (int i = 0; i < n; i++) cin >> pos[i][0] >> pos[i][1];
  int money[n];
  for (int i = 0; i < n - 1; i++) money[i] = (int)1e9;
  money[n - 1] = 0;
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n - 1; i++) {
      for (int j = 0; j < n; j++) {
        if (i == j) continue;
        int m = dis(i, j) * d - power[i];
        money[i] = min(money[i], max(money[j] + m, 0));
      }
    }
  }
  cout << money[0] << endl;
  return 0;
}
