#include <bits/stdc++.h>
using namespace std;
int n, D;
long long a[105], X[105], Y[105];
int d[105][105];
void init() {
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) d[i][j] = (1 << 30);
  for (int i = 0; i < n; ++i) d[i][i] = 0;
}
void floyd() {
  for (int k = 0; k < n; ++k)
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}
int main() {
  while (cin >> n >> D) {
    a[0] = a[n - 1] = 0;
    init();
    for (int i = 1; i < n - 1; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) cin >> X[i] >> Y[i];
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j)
        if (i != j) d[i][j] = D * (abs(X[i] - X[j]) + abs(Y[i] - Y[j])) - a[i];
    floyd();
    cout << d[0][n - 1] << endl;
  }
}
