#include <bits/stdc++.h>
using namespace std;
const int MAXN = 107, INF = 1e9;
int n, d, a[MAXN], w[MAXN][MAXN], x[MAXN], y[MAXN], dis[MAXN];
bitset<MAXN> inq;
bool check(int lim) {
  for (int i = 1; i <= n; ++i) inq[i] = 0;
  for (int i = 1; i <= n; ++i) dis[i] = INF;
  dis[1] = 0;
  queue<int> q;
  q.push(1);
  while (q.size()) {
    int u = q.front();
    if (u == n) return 1;
    inq[u] = 0;
    q.pop();
    for (int v = 1; v <= n; ++v) {
      int cur = dis[u] + w[u][v];
      if (cur <= lim && dis[v] > cur) {
        dis[v] = cur;
        if (!inq[v]) inq[v] = 1, q.push(v);
      }
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> d;
  for (int i = 2; i < n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) cin >> x[i] >> y[i];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (i != j) w[i][j] = d * (abs(x[i] - x[j]) + abs(y[i] - y[j])) - a[i];
  int l = 0, r = INF, res = INF;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      res = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  cout << res;
  return 0;
}
