#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const long long INF = 1e18 + 7;
const int MAXN = 1e3 + 5;
const double eps = 1e-9;
using namespace std;
long long a[MAXN], dist[MAXN];
pair<long long, long long> loc[MAXN];
int par[MAXN];
long long cost(int x, int y, long long d) {
  return d * (abs(loc[x].first - loc[y].first) +
              abs(loc[x].second - loc[y].second));
}
int main() {
  long long n, d;
  scanf("%I64d", &(n)), scanf("%I64d", &(d));
  for (int i = 1; i + 1 < n; i++) scanf("%I64d", &(a[i]));
  for (int i = 0; i < n; i++)
    scanf("%I64d", &(loc[i].first)), scanf("%I64d", &(loc[i].second)),
        dist[i] = INF;
  dist[0] = 0;
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >,
                 greater<pair<long long, long long> > >
      pq;
  pq.push({0, 0});
  while (!pq.empty()) {
    pair<long long, long long> cur = pq.top();
    pq.pop();
    for (int i = 0; i < n; i++) {
      if (i == cur.second) continue;
      long long c = cost(i, cur.second, d);
      if (dist[i] > dist[cur.second] + c - a[i]) {
        dist[i] = dist[cur.second] + c - a[i];
        pq.push({dist[i], i});
        par[i] = cur.second;
      }
    }
  }
  printf("%I64d\n", (dist[n - 1]));
  return 0;
}
