#include <bits/stdc++.h>
using namespace std;
int n, d, a[111], x[111], y[111], money[111];
bool accept(int value) {
  memset(money, 1, sizeof(money));
  set<pair<int, int> > q;
  q.insert(make_pair(money[1] = -value, 1));
  while (!q.empty()) {
    pair<int, int> top = *q.begin();
    q.erase(top);
    int u = top.second;
    for (int v = (1), _b = (n); v <= _b; v++)
      if (u != v) {
        int cost = (abs(x[u] - x[v]) + abs(y[u] - y[v])) * d;
        int newMoney = money[u] + cost;
        if (newMoney <= 0 && newMoney - a[v] < money[v]) {
          newMoney -= a[v];
          q.erase(make_pair(money[v], v));
          money[v] = newMoney;
          q.insert(make_pair(money[v], v));
        }
      }
  }
  return money[n] <= 0;
}
int main() {
  scanf("%d %d", &n, &d);
  a[0] = a[n] = 0;
  for (int i = (2), _b = (n - 1); i <= _b; i++) scanf("%d", &a[i]);
  for (int i = (1), _b = (n); i <= _b; i++) scanf("%d %d", &x[i], &y[i]);
  int lo = 1, hi = 1000111222, res = 1000111222;
  while (lo <= hi) {
    int mid = (lo + hi) >> 1;
    if (accept(mid)) {
      res = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  printf("%d\n", res);
  return 0;
}
