#include <bits/stdc++.h>
using namespace std;
const long long mod19 = 1000000009;
const long long mod17 = 1000000007;
pair<int, int> A[101];
int arr[101];
int dist[101], n, d;
bool used[101];
void djikstra() {
  for (int i = 2; i <= 100; ++i) dist[i] = 1000000000;
  for (int i = 1; i <= n; ++i) {
    int v = -1;
    for (int j = 1; j <= n; ++j) {
      if (!used[j] && dist[j] != 1000000000 && (v == -1 || dist[v] > dist[j]))
        v = j;
    }
    if (v == -1) break;
    used[v] = true;
    for (int j = 1; j <= n; ++j) {
      if (used[j]) continue;
      int di = abs(A[v].first - A[j].first) + abs(A[v].second - A[j].second);
      int time = d * di - arr[j];
      if (dist[j] > time + dist[v]) {
        dist[j] = time + dist[v];
      }
    }
  }
}
int main() {
  scanf("%d%d", &n, &d);
  for (int i = 2; i <= n - 1; ++i) scanf("%d", &arr[i]);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &A[i].first, &A[i].second);
  }
  djikstra();
  printf("%d", dist[n]);
  return 0;
}
