#include <bits/stdc++.h>
using namespace std;
int dis[107][107], x[107], y[107], a[107];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, d;
  cin >> n >> d;
  for (int i = 1; i < n - 1; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (i != j) dis[i][j] = (abs(x[i] - x[j]) + abs(y[i] - y[j])) * d - a[j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      for (int k = 0; k < n; k++)
        dis[j][k] = min(dis[j][k], dis[j][i] + dis[i][k]);
  cout << dis[0][n - 1];
}
