#include <bits/stdc++.h>
using namespace std;
long long n, d, x[105], y[105], dist[105][105], a[105];
long long calc(long long i, long long j) {
  long long ans = abs(x[i] - x[j]) + abs(y[i] - y[j]);
  return ans * d;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  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++)
      if (i != j) dist[i][j] = calc(i, j) - a[i];
  for (long long k = 1; k <= n; k++)
    for (long long i = 1; i <= n; i++)
      for (long long j = 1; j <= n; j++)
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
  cout << dist[1][n];
}
