#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  int d;
  cin >> d;
  vector<int> a(n);
  for (int i = 1; i < n - 1; i++) cin >> a[i];
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  vector<long long> dp(n, INF);
  dp.back() = 0;
  for (int _ = 0; _ < n; _++) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        if (i != j) {
          long long dist = abs(x[i] - x[j]) + abs(y[i] - y[j]);
          chmin(dp[i], max(0LL, dp[j] - a[j]) + dist * d);
        }
  }
  cout << dp.front() << endl;
  return 0;
}
