#include <bits/stdc++.h>
using namespace std;
int A[105], X[105], Y[105];
int D[105][105];
int main() {
  int n, d;
  while (scanf("%d%d", &n, &d) == 2) {
    for (int i = 1; i < n - 1; i++) scanf("%d", &A[i]);
    for (int i = 0; i < n; i++) scanf("%d%d", &X[i], &Y[i]);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        D[i][j] = d * (abs(X[i] - X[j]) + abs(Y[i] - Y[j])) - A[j];
    for (int i = 0; i < n; i++) D[i][i] = 0;
    for (int k = 0; k < n; k++) {
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
          D[i][j] = min(D[i][j], D[i][k] + D[k][j]);
        }
      }
    }
    printf("%d\n", D[0][n - 1]);
  }
}
