#include <bits/stdc++.h>
using namespace std;
long long dist[110][110];
long long arr[110], x[110], y[110];
int main() {
  long long n, d;
  cin >> n >> d;
  arr[1] = arr[n] = 0;
  for (int i = 2; i < n; i++) cin >> arr[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++) {
      if (i != j)
        dist[i][j] = d * (abs(x[i] - x[j]) + abs(y[i] - y[j])) - arr[j];
      else
        dist[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      for (int k = 1; k <= n; k++)
        dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
  cout << dist[1][n] << endl;
  return 0;
}
