#include <bits/stdc++.h>
using namespace std;
const int nmax = 102;
int n, d;
int a[nmax];
pair<int, int> p[nmax];
int dist[nmax][nmax];
inline int getDist(int i, int j) {
  return abs(p[i].first - p[j].first) + abs(p[i].second - p[j].second);
}
int main() {
  cin >> n >> d;
  for (int i = 2; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i != j) dist[i][j] = d * getDist(i, j) - a[i];
    }
  }
  for (int k = 1; k <= n; k++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
      }
    }
  }
  cout << dist[1][n] << "\n";
  return 0;
}
