#include <bits/stdc++.h>
using namespace std;
int dis[110];
int water[110];
int input[110];
pair<int, int> cor[110];
int vis[110];
int n, d;
int caldis(int i, int j) {
  return d * (abs(cor[i].first - cor[j].first) +
              abs(cor[i].second - cor[j].second));
}
int main() {
  cin >> n >> d;
  for (int i = 2; i <= n - 1; i++) {
    cin >> input[i];
  }
  int x, y;
  for (int i = 1; i <= n; i++) {
    cin >> x >> y;
    cor[i].first = x;
    cor[i].second = y;
  }
  for (int i = 2; i <= n; i++) {
    dis[i] = caldis(i, 1);
  }
  int cur = 1;
  vis[1] = 1;
  while (cur != n) {
    int index = 0;
    int mini = 100000000;
    for (int i = 2; i <= n; i++) {
      if (!vis[i] && mini > dis[i]) {
        index = i;
        mini = dis[i];
      }
    }
    cur = index;
    vis[cur] = 1;
    for (int i = 2; i <= n; i++) {
      if (vis[i]) continue;
      int morewater = water[cur] + input[cur] - caldis(cur, i);
      int extra = 0;
      if (morewater < 0) {
        extra = -morewater;
        morewater = 0;
      }
      if (dis[i] > dis[cur] + extra ||
          (dis[i] == dis[cur] + extra && water[i] < morewater)) {
        dis[i] = dis[cur] + extra;
        water[i] = morewater;
      }
    }
  }
  cout << dis[n];
  return 0;
}
