#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int n, d;
int val[105];
pair<int, int> p[105];
int buf[205][205];
int dp[205][205];
int main() {
  cin >> n >> d;
  for (int i = 0; i < n - 2; ++i) cin >> val[i + 1];
  for (int i = 0; i < n; ++i) {
    cin >> p[i].first >> p[i].second;
  }
  if (p[0].first > p[n - 1].first) {
    for (int i = 0; i < n; ++i) p[i].first *= -1;
  }
  if (p[0].second > p[n - 1].second)
    for (int i = 0; i < n; ++i) p[i].second *= -1;
  for (int i = 0; i < n; ++i) p[i].first += 100, p[i].second += 100;
  for (int i = 1; i < n - 1; ++i) {
    buf[p[i].first][p[i].second] = val[i];
  }
  for (int i = 0; i < 205; ++i)
    for (int j = 0; j < 205; ++j) dp[i][j] = INF;
  dp[p[0].first][p[0].second] = 0;
  priority_queue<pair<int, pair<int, int> >,
                 vector<pair<int, pair<int, int> > >,
                 greater<pair<int, pair<int, int> > > >
      pq;
  pq.push(make_pair(0, p[0]));
  int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
  while (!pq.empty()) {
    pair<int, pair<int, int> > cur = pq.top();
    pq.pop();
    if (dp[cur.second.first][cur.second.second] < cur.first) continue;
    for (int k = 0; k < 4; ++k) {
      int px = cur.second.first + dx[k], py = cur.second.second + dy[k];
      if (px < 0 || py < 0 || px >= 201 || py >= 201 ||
          dp[px][py] <= cur.first - buf[px][py] + d)
        continue;
      dp[px][py] = cur.first - buf[px][py] + d;
      pq.push(make_pair(dp[px][py], make_pair(px, py)));
    }
  }
  int worth = dp[p[n - 1].first][p[n - 1].second];
  printf("%d\n", worth);
  return 0;
}
