#include <bits/stdc++.h>
using namespace std;
int n, d;
int a[110];
int x[110];
int y[110];
int cost[110];
bool visited[110];
int dist(int x, int y, int u, int v) { return abs(u - x) + abs(v - y); }
bool dfs(int u, int v) {
  int dd;
  if (u == n) {
    return true;
  }
  if (v <= cost[u]) {
    return false;
  }
  visited[u] = true;
  for (int i = 1; i < n + 1; i += 1) {
    if (!visited[i]) {
      dd = dist(x[i], y[i], x[u], y[u]) * d;
      if (v >= dd) {
        if (dfs(i, v + a[i] - dd)) {
          return true;
        }
      }
    }
  }
  visited[u] = false;
  cost[u] = v;
  return false;
}
int main(int argc, char *argv[]) {
  int hi, lo, mid;
  scanf("%d %d", &n, &d);
  for (int i = 2; i < n; i += 1) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i < n + 1; i += 1) {
    scanf("%d %d", &x[i], &y[i]);
  }
  lo = 0;
  hi = 40000000;
  while (lo != hi) {
    mid = lo + (hi - lo) / 2;
    for (int i = 1; i < n + 1; i += 1) {
      cost[i] = -40000000;
      visited[i] = false;
    }
    if (dfs(1, mid)) {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  printf("%d\n", lo);
  return 0;
}
