#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  cin >> n >> d;
  int a[n], temp;
  a[0] = a[n - 1] = 0;
  for (temp = 1; temp < n - 1; temp++) cin >> a[temp];
  int dist[n][n], x[n], y[n];
  for (temp = 0; temp < n; temp++) cin >> x[temp] >> y[temp];
  int temp2;
  for (temp = 0; temp < n; temp++) {
    for (temp2 = 0; temp2 < n; temp2++) {
      if (temp == temp2)
        dist[temp][temp2] = 0;
      else
        dist[temp][temp2] =
            (abs(x[temp] - x[temp2]) + abs(y[temp] - y[temp2])) * d - a[temp2];
    }
  }
  int temp3;
  for (temp = 0; temp < n; temp++) {
    for (temp2 = 0; temp2 < n; temp2++) {
      for (temp3 = 0; temp3 < n; temp3++) {
        dist[temp2][temp3] =
            min(dist[temp2][temp3], dist[temp2][temp] + dist[temp][temp3]);
      }
    }
  }
  cout << dist[0][n - 1] << "\n";
}
