#include <bits/stdc++.h>
using namespace std;
vector<long long> a;
vector<pair<long long, long long> > points;
int n, d;
int dist(int i, int j) {
  return abs(points[i].first - points[j].first) +
         abs(points[i].second - points[j].second);
}
bool check(int mid) {
  vector<bool> vis(n, 0);
  vector<long long> dis(n, -1);
  priority_queue<pair<long long, long long> > dfs;
  dfs.push(make_pair(mid, 0));
  while (!dfs.empty()) {
    int mon = dfs.top().first, curr = dfs.top().second;
    dfs.pop();
    vis[curr] = true;
    if (curr == n - 1) return true;
    for (int i = 0; i < n; i++) {
      if (i != curr && d * dist(i, curr) <= mon &&
          dis[i] < mon - d * dist(i, curr) + a[i]) {
        dis[i] = mon - d * dist(i, curr) + a[i];
        dfs.push(make_pair(dis[i], i));
      }
    }
  }
  return false;
}
int main() {
  cin >> n >> d;
  a.resize(n);
  points.resize(n);
  for (int i = 1; i < n - 1; i++) cin >> a[i];
  a[0] = a[n - 1] = 0;
  for (int i = 0; i < n; i++) cin >> points[i].first >> points[i].second;
  int left = 0, right = 1000000000 + 1;
  while (left < right) {
    int mid = (right - left) / 2 + left;
    if (check(mid))
      right = mid;
    else
      left = mid + 1;
  }
  cout << left << endl;
}
