#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    pq;
vector<long long> dist;
vector<long long> va;
vector<pair<int, int> > nodo;
vector<vector<pair<int, int> > > adj;
void solver(int begin) {
  dist[begin] = 0;
  pq.push({0, begin});
  while (!pq.empty()) {
    int atual_dis = pq.top().first;
    int atual = pq.top().second;
    pq.pop();
    for (pair<int, int> edge : adj[atual]) {
      int next_edge = edge.first, dis_edge = edge.second;
      if (dist[atual] + dis_edge < dist[next_edge]) {
        pq.push({dis_edge, next_edge});
        dist[next_edge] = dist[atual] + dis_edge;
      }
    }
  }
}
int main() {
  int c, d;
  cin >> c >> d;
  va.assign(c, 0);
  dist.assign(c + 1, 1e9);
  adj.assign(c, vector<pair<int, int> >(0));
  va[0] = 0;
  va[c - 1] = 0;
  for (int i = 1; i <= c - 2; i++) {
    int a;
    scanf("%d", &a);
    va[i] = a;
  }
  for (int i = 0; i < c; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    nodo.push_back({a, b});
  }
  for (int i = 0; i < c; i++) {
    for (int j = i; j < c; j++) {
      if (i != j) {
        int dis = ((abs(nodo[i].first - nodo[j].first) +
                    abs(nodo[i].second - nodo[j].second)) *
                   d);
        adj[i].push_back({j, dis - va[j]});
        adj[j].push_back({i, dis - va[i]});
      }
    }
  }
  solver(0);
  cout << dist[c - 1] << endl;
}
