#include <bits/stdc++.h>
using namespace std;
int cred[102];
bitset<102> stations;
pair<int, int> coor[102];
int obtdist(int i, int j) {
  return (abs(coor[i].first - coor[j].first) +
          abs(coor[i].second - coor[j].second));
}
int main() {
  int n, d, x, y;
  scanf("%d%d", &n, &d);
  for (int i = (1); i < (n - 1); i++) {
    scanf("%d", &x);
    cred[i] = x;
  }
  for (int i = (0); i < (n); i++) {
    scanf("%d%d", &x, &y);
    coor[i] = make_pair(x, y);
  }
  priority_queue<pair<int, pair<int, int> > > dij;
  dij.push(make_pair(0, make_pair(0, 0)));
  stations.reset();
  while (!dij.empty()) {
    int nodo = dij.top().second.second;
    int costo = -dij.top().first;
    int credito = dij.top().second.first;
    if (nodo == (n - 1)) {
      break;
    }
    dij.pop();
    if (stations[nodo]) continue;
    stations[nodo] = 1;
    for (int i = (0); i < (n); i++) {
      if (!stations[i]) {
        int creditoac = credito;
        int costoac = costo;
        int dist = obtdist(i, nodo) * d;
        if (creditoac >= dist) {
          creditoac -= dist;
        } else {
          costoac += (dist - creditoac);
          creditoac = 0;
        }
        creditoac += cred[i];
        dij.push(make_pair(-costoac, make_pair(creditoac, i)));
      }
    }
  }
  printf("%d\n", -dij.top().first);
  return 0;
}
