#include <bits/stdc++.h>
using namespace std;
long long a[103], x[103], y[103];
long long dp[103][103];
int main() {
  ios ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, d;
  cin >> n >> d;
  for (long long i = 2; i <= n - 1; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) cin >> x[i] >> y[i];
  a[1] = -1e18;
  a[n] = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      dp[i][j] = d * abs(x[i] - x[j]) + d * abs(y[i] - y[j]) - a[j];
    }
    dp[i][i] = 0;
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= n; j++)
      for (long long k = 1; k <= n; k++)
        dp[j][k] = min(dp[j][k], dp[j][i] + dp[i][k]);
  cout << dp[1][n] << endl;
}
