#include <bits/stdc++.h>
using namespace std;
int dp[105][105] = {0};
int a[105], x[105], y[105];
int main() {
  int n, d;
  scanf("%d%d", &n, &d);
  for (int i = 2; i <= n - 1; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x[i], &y[i]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      dp[i][j] = d * (abs(x[i] - x[j]) + abs(y[i] - y[j])) - a[i];
    }
  }
  for (int k = 1; k <= n; k++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (i != j && j != k && i != k && dp[i][j] > dp[i][k] + dp[k][j])
          dp[i][j] = dp[i][k] + dp[k][j];
      }
    }
  }
  if (dp[1][n] < 0)
    printf("0\n");
  else
    printf("%d\n", dp[1][n]);
  return 0;
}
