#include <bits/stdc++.h>
using namespace std;
using pii = pair<long long, long long>;
const long long N = 105;
const long long inf = 1e12 + 42;
long long x[N], y[N], a[N];
long long n, d;
long long g[N][N];
long long dijsktra(long long s, long long n);
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> d;
  for (long long i = 2; i <= n - 1; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      g[i][j] = (abs(x[i] - x[j]) + abs(y[i] - y[j])) * d - a[i];
      if (g[i][j] < 0) g[i][j] = 0;
    }
  }
  long long ans = dijsktra(1, n);
  cout << ans << '\n';
  return 0;
}
long long dijsktra(long long s, long long n) {
  vector<long long> dist(n + 1, inf);
  priority_queue<pii, vector<pii>, greater<pii> > q;
  q.push({0, s});
  dist[s] = 0;
  while (!q.empty()) {
    long long u, uw;
    tie(uw, u) = q.top(), q.pop();
    if (dist[u] != uw) continue;
    for (long long v = 1; v <= n; v++) {
      if (v == u) continue;
      if (dist[v] > dist[u] + g[u][v]) {
        dist[v] = dist[u] + g[u][v];
        q.push({dist[v], v});
      }
    }
  }
  return dist[n];
}
