#include <bits/stdc++.h>
using namespace std;
int n, d, x[111], y[111], a[111], f[111][111];
int main() {
  cin >> n >> d;
  for (int i = 0; i < n - 2; i++) cin >> a[i + 1];
  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) f[i][j] = (abs(x[i] - x[j]) + abs(y[i] - y[j])) * d - a[i];
  for (int k = 0; k < n; k++)
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) f[i][j] = min(f[i][j], f[i][k] + f[k][j]);
  cout << f[0][n - 1];
}
