#include <bits/stdc++.h>
using namespace std;
const int mn = 1000000 + 1;
vector<pair<int, int> > yal[mn];
long long int d[mn];
set<pair<int, int> > di;
int main() {
  int n, dd;
  cin >> n >> dd;
  int ai[n + 1];
  for (int i = 2; i < n; i++) {
    cin >> ai[i];
  }
  ai[1] = 0;
  ai[n] = 0;
  int xi[n + 1], yi[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> xi[i] >> yi[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) {
        continue;
      }
      int fa = abs(xi[i] - xi[j]) + abs(yi[i] - yi[j]);
      yal[i].push_back({j, dd * fa - ai[j]});
      yal[j].push_back({i, dd * fa - ai[i]});
    }
  }
  memset(d, 63, sizeof(d));
  d[1] = 0;
  di.insert({d[1], 1});
  while (di.size()) {
    int u = (*di.begin()).second;
    for (int i = 0; i < yal[u].size(); i++) {
      int v = yal[u][i].first, w = yal[u][i].second;
      if (d[v] > d[u] + w) {
        di.erase({d[v], v});
        d[v] = d[u] + w;
        di.insert({d[v], v});
      }
    }
    di.erase({d[u], u});
  }
  cout << d[n];
}
