#include <bits/stdc++.h>
using namespace std;
ifstream Cin("input.txt");
ofstream Cout("output.txt");
struct pt {
  long long x, y;
  void get() { cin >> x >> y; }
  long long dist(pt a) { return abs(a.x - x) + abs(a.y - y); }
};
map<pt, map<pt, long long> > m;
int main() {
  long long n, d, a[100] = {}, m[100][100] = {}, i, j, k;
  pt v[100];
  cin >> n >> d;
  for (i = 1; i < n - 1; i++) cin >> a[i];
  for (i = 0; i < n; ++i) v[i].get();
  for (i = 0; i < n; ++i)
    for (j = 0; j < n; ++j) {
      if (i == j)
        m[i][j] = (long long)1e15;
      else
        m[i][j] = d * v[i].dist(v[j]) - a[i];
    }
  for (k = 0; k < n; ++k)
    for (i = 0; i < n; ++i)
      for (j = 0; j < n; ++j)
        if (k != i && k != j && i != j)
          if (m[i][j] > m[i][k] + m[k][j]) m[i][j] = m[i][k] + m[k][j];
  cout << m[0][n - 1];
}
