#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int pos[N][2], a[N];
int dp[N], n, vis[N], d, par[N];
queue<int> Q;
bool spfa(int s) {
  Q.push(0);
  memset(dp, -1, sizeof(dp));
  memset(par, -1, sizeof(par));
  memset(vis, 0, sizeof(vis));
  dp[0] = s;
  par[0] = -1;
  while (!Q.empty()) {
    int now = Q.front();
    Q.pop();
    int x = pos[now][0];
    int y = pos[now][1];
    int value = dp[now];
    vis[now] = 0;
    for (int v = 0; v < n; v++) {
      if (v == now) continue;
      int tmp = now, flag = 1;
      while (par[tmp] != -1) {
        tmp = par[tmp];
        if (tmp == v) {
          flag = 0;
          break;
        }
      }
      if (!flag) continue;
      int vx = pos[v][0];
      int vy = pos[v][1];
      int cost = d * (abs(vx - x) + abs(vy - y));
      if (dp[now] - cost >= 0 && dp[now] - cost + a[v] > dp[v]) {
        dp[v] = dp[now] - cost + a[v];
        par[v] = now;
        if (vis[v] == 0) {
          vis[v] = 1;
          Q.push(v);
        }
      }
    }
  }
  return dp[n - 1] != -1;
}
int main() {
  cin >> n >> d;
  for (int i = 1; i < n - 1; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    cin >> pos[i][0] >> pos[i][1];
  }
  int l = 0, r = (int)1e9;
  while (l < r) {
    int mid = l + r >> 1;
    if (spfa(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << r << endl;
}
