#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0)
    return (b);
  else
    return (gcd(b % a, a));
}
long long int fastpow(long long int a, long long int n, long long int temp) {
  if (n == 0) return (1);
  if (n == 1) return ((a * temp) % 1000000007);
  if (n & 1) temp = (temp * a) % 1000000007;
  return (fastpow((a * a) % 1000000007, n / 2, temp));
}
char dum;
int n, d, x[101], y[101];
long long int dp[101][101], a[101];
long long int finddist(int i, int j) {
  return ((abs(x[i] - x[j]) + abs(y[i] - y[j])) * d - a[j]);
}
long long int solve() {
  for (int i = 1; i < n + 1; i++)
    for (int j = 1; j < n + 1; j++) {
      dp[i][j] = finddist(i, j);
      dp[i][i] = 0;
    }
  for (int k = 1; k < n + 1; k++) {
    for (int i = 1; i < n + 1; i++) {
      for (int j = 1; j < n + 1; j++)
        if (i != j and j != k and i != k)
          dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
    }
  }
  return (dp[1][n]);
}
int main() {
  scanf("%d", &n);
  scanf("%d", &d);
  for (int i = 2; i <= n - 1; i++) cin >> a[i];
  for (int i = 1; i < n + 1; i++) scanf("%d", &x[i]), scanf("%d", &y[i]);
  cout << solve();
}
