#include <bits/stdc++.h>
using namespace std;
long long int dist[101][101];
int main() {
  ios::sync_with_stdio(false);
  int n, d;
  cin >> n >> d;
  int a[n + 1];
  a[1] = 0;
  a[n] = 0;
  for (int i = 2; i < n; i++) cin >> a[i];
  pair<int, int> p[n];
  for (int i = 0; i < n; i++) cin >> p[i].first >> p[i].second;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i != j) {
        long long int t =
            abs(p[i].first - p[j].first) + abs(p[i].second - p[j].second);
        t *= d;
        dist[i][j] = t - a[i + 1];
      }
    }
  }
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (dist[i][j] > dist[i][k] + dist[k][j]) {
          dist[i][j] = dist[i][k] + dist[k][j];
        }
      }
    }
  }
  cout << dist[0][n - 1];
  return 0;
}
