#include <bits/stdc++.h>
using namespace std;
const int N = 152;
const int M = N + N;
int n, d, v[N], x[N], y[N], mat[M][M];
long long dp[M][M];
int ta, tb;
int main() {
  scanf("%d %d", &n, &d);
  for (int i = 2; i < n; i++) scanf("%d", v + i);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", x + i, y + i);
    mat[x[i] + N][y[i] + N] = v[i];
  }
  ta = x[n] + N, tb = y[n] + N;
  memset(dp, 0x3f, sizeof dp);
  dp[x[1] + N][y[1] + N] = 0;
  priority_queue<tuple<long long, int, int>> q;
  q.emplace(0, x[1] + N, y[1] + N);
  int dx[] = {1, -1, 0, 0};
  int dy[] = {0, 0, -1, 1};
  int a, b;
  long long dd;
  while (!q.empty()) {
    tie(dd, a, b) = q.top();
    q.pop();
    if (dd > dp[a][b]) continue;
    for (int i = 0; i < 4; i++) {
      int aa = a + dx[i], bb = b + dy[i];
      if (aa < 0 || aa >= M) continue;
      if (bb < 0 || bb >= M) continue;
      int w = d - mat[aa][bb];
      if (dp[aa][bb] > dp[a][b] + w) {
        dp[aa][bb] = dp[a][b] + w;
        q.emplace(-dp[aa][bb], aa, bb);
      }
    }
  }
  printf("%lld\n", dp[ta][tb]);
}
