#include <bits/stdc++.h>
using namespace std;
const int N = 111;
const int INF = 1 << 29;
int x[N], y[N], n, d;
int D(int i, int j) { return d * (abs(x[i] - x[j]) + abs(y[i] - y[j])); }
int dp[N][N], a[N];
int main() {
  cin >> n >> d;
  for (int i = 2; i <= n - 1; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) cin >> x[i] >> y[i];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) {
      dp[i][j] = D(i, j) - a[i];
    }
  for (int i = 1; i <= n; ++i) dp[i][i] = INF;
  for (int k = 1; k <= n; ++k)
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        if (dp[i][j] > dp[i][k] + dp[k][j]) dp[i][j] = dp[i][k] + dp[k][j];
  cout << dp[1][n] << endl;
  return 0;
}
