#include <bits/stdc++.h>
using namespace std;
const int N = 110;
const long long INF = 0x3f3f3f3f3f3f3f3f;
int n, d;
long long dist[N], g[N][N];
bool st[N];
struct Node {
  int x, y, w;
} node[N];
long long dijkstra() {
  for (int i = 1; i <= n; i++) dist[i] = (1ll << 63) - 1;
  dist[1] = 0;
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  q.push({0, 1});
  while (q.size()) {
    pair<int, int> it = q.top();
    q.pop();
    int u = it.second;
    if (st[u]) continue;
    st[u] = 1;
    for (int i = 1; i <= n; i++) {
      if (u != i && !st[i] && dist[i] > dist[u] + g[u][i]) {
        dist[i] = dist[u] + g[u][i];
        q.push({dist[i], i});
      }
    }
  }
  return dist[n];
}
int main() {
  scanf("%d%d", &n, &d);
  for (int i = 2; i < n; i++) scanf("%d", &node[i].w);
  for (int i = 1; i <= n; i++) scanf("%d%d", &node[i].x, &node[i].y);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j)
        g[i][j] =
            d * (abs(node[i].x - node[j].x) + abs(node[i].y - node[j].y)) -
            node[j].w;
      else
        g[i][j] = INF;
  printf("%lld\n", dijkstra());
  return 0;
}
