#include <bits/stdc++.h>
using namespace std;
int t[150], ex[150], x[150], y[150], used[150];
int line[12000];
int n, d;
void init();
int dis(int a, int b) {
  return ((x[a] > x[b]) ? x[a] - x[b] : x[b] - x[a]) +
         ((y[a] > y[b]) ? y[a] - y[b] : y[b] - y[a]);
}
int main() {
  int i, a, b, cost;
  init();
  line[0] = n - 1;
  used[n - 1] = 1;
  for (a = 0, b = 0; a <= b; ++a) {
    for (i = 0; i < n; ++i) {
      if (line[a] == i) continue;
      cost = t[line[a]] + d * dis(line[a], i) - ex[line[a]];
      if (cost < 0) cost = 0;
      if ((t[i] == -1) || (t[i] > cost)) {
        t[i] = cost;
        if (!used[i]) {
          line[++b] = i;
          used[i] = 1;
        }
      }
    }
    used[line[a]] = 0;
  }
  cout << t[0] << endl;
  return 0;
}
void init() {
  int i;
  cin >> n >> d;
  ex[0] = 0;
  ex[n - 1] = 0;
  for (i = 1; i < n - 1; ++i) cin >> ex[i];
  for (i = 0; i < n; ++i) cin >> x[i] >> y[i];
  for (i = 0; i < n - 1; ++i) {
    t[i] = -1;
    used[i] = 0;
  }
  t[n - 1] = 0;
  return;
}
