#include <bits/stdc++.h>
using namespace std;
int n, d, a[112], x[112], y[112], ans[112];
set<pair<int, int> > st;
vector<pair<int, int> > ad[112];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> d;
  for (int i = 0; i < n - 2; i++) {
    cin >> a[i + 1];
  }
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    ans[i] = 1e9;
  }
  ans[0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int dis = (abs(x[i] - x[j]) + abs(y[i] - y[j])) * d;
      ad[i].push_back(make_pair(j, dis - a[i]));
      ad[j].push_back(make_pair(i, dis - a[j]));
    }
  }
  st.insert(make_pair(0, 0));
  while (st.size()) {
    int now = st.begin()->first;
    st.erase(st.begin());
    for (int i = 0; i < ad[now].size(); i++) {
      int x = ad[now][i].first;
      int w = ad[now][i].second;
      if (ans[x] > ans[now] + w) {
        st.erase(make_pair(x, ans[x]));
        ans[x] = ans[now] + w;
        st.insert(make_pair(x, ans[x]));
      }
    }
  }
  cout << ans[n - 1];
  return 0;
}
