#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int INF = 2e9;
const long long LNF = 9e18;
const int mod = 1e9 + 7;
const int maxn = 100 + 10;
int n, d, a[maxn], x[maxn], y[maxn];
int dis[maxn][maxn];
int main() {
  cin >> n >> d;
  for (int i = 2; i < n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      dis[i][j] =
          (i == j) ? 0 : (d * (abs(x[i] - x[j]) + abs(y[i] - y[j])) - a[i]);
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
  cout << dis[1][n] << endl;
}
