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