#include <bits/stdc++.h>
using namespace std;
int a[105];
int x[105], y[105];
int dis(int n1, int n2) { return abs(x[n1] - x[n2]) + abs(y[n1] - y[n2]); }
int main() {
  int n, d;
  cin >> n >> d;
  for (int i = 0; i < (n - 2); ++i) cin >> a[i + 1];
  for (int i = 0; i < (n); ++i) cin >> x[i] >> y[i];
  priority_queue<pair<int, int> > pq;
  pq.push(make_pair(0, 0));
  set<int> visited;
  int ans = 0;
  a[0] = 0;
  while (!pq.empty()) {
    pair<int, int> p = pq.top();
    pq.pop();
    if (visited.count(p.second) > 0) continue;
    visited.insert(p.second);
    if (p.first < 0 && p.first < ans) ans = p.first;
    if (p.second == n - 1) {
      cout << -ans << endl;
      return 0;
    }
    for (int i = 0; i < (n); ++i) {
      if (visited.count(i) == 0)
        pq.push(make_pair(p.first - dis(p.second, i) * d + a[p.second], i));
    }
  }
}
