#include <bits/stdc++.h>
using namespace std;
int m, n, d;
int a[200][200];
int dist[200];
int x[200], y[200];
int costs[200];
bool used[200];
int main() {
  int k;
  scanf("%d %d", &n, &d);
  costs[0] = costs[n - 1] = 0;
  for (int i = 1; i < n - 1; ++i) {
    scanf("%d", costs + i);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", x + i, y + i);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      a[i][j] = d * (abs(x[i] - x[j]) + abs(y[i] - y[j])) - costs[j];
    }
  }
  int cur = 0;
  used[cur] = true;
  dist[cur] = 0;
  for (;;) {
    int curd = dist[cur];
    for (int j = 1; j < n; ++j) {
      if (!used[j]) {
        int ndist = a[cur][j] + curd;
        if (dist[j] == 0 || ndist < dist[j]) dist[j] = ndist;
      }
    }
    int next = 1;
    for (; next < n && used[next]; ++next)
      ;
    if (next == n) break;
    int min = dist[next];
    for (int j = next + 1; j < n; ++j) {
      if (used[j]) continue;
      if (dist[j] < min) min = dist[j], next = j;
    }
    cur = next;
    used[cur] = true;
  }
  printf("%d", dist[n - 1]);
  return 0;
}
