#include <bits/stdc++.h>
const int N = 200010;
const int inf = 0x3f3f3f3f;
using namespace std;
int x[1010], y[1010];
int a[1010];
int dp[1010], n, d;
int vis[1010];
void spfa(int s) {
  queue<int> que;
  que.push(s);
  vis[s] = 1;
  memset(dp, 0x3f, sizeof(dp));
  dp[s] = 0;
  while (((que).size())) {
    int u = que.front();
    que.pop();
    vis[u] = 0;
    for (int i = 1; i < n; i++) {
      if (i == u) continue;
      if (dp[i] <=
          max(0, dp[u] + d * abs(x[u] - x[i]) + d * abs(y[u] - y[i]) - a[i]))
        continue;
      dp[i] =
          max(0, dp[u] + d * abs(x[u] - x[i]) + d * abs(y[u] - y[i]) - a[i]);
      if (vis[i]) continue;
      vis[i] = 1;
      que.push(i);
    }
  }
}
int main() {
  scanf("%d%d", &n, &d);
  for (int i = 2; i < n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d%d", &x[i], &y[i]);
  spfa(n);
  cout << dp[1] << endl;
  return 0;
}
