#include <bits/stdc++.h>
using namespace std;
int x[110], y[110];
int a[110], money[110];
bool isVisited[110];
int main(void) {
  int n, d;
  cin >> n >> d;
  for (int i = 2; i <= n - 1; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    money[i] = 10000 * d;
    isVisited[i] = false;
  }
  money[1] = 0;
  int next = 1;
  while (next != n) {
    isVisited[next] = true;
    for (int i = 1; i <= n; i++) {
      if (!isVisited[i]) {
        int newMoney = money[next] +
                       (abs(x[i] - x[next]) + abs(y[i] - y[next])) * d -
                       a[next];
        if (newMoney < money[i]) money[i] = newMoney;
      }
    }
    int min = 10000 * d;
    next = 1;
    for (int i = 1; i <= n; i++) {
      if (!isVisited[i] && money[i] < min) {
        next = i;
        min = money[i];
      }
    }
  }
  cout << money[n] << endl;
  return 0;
}
