#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int d, n;
int a[105];
int x[105], y[105];
int g[105][105];
bool vis[105];
int dis[105];
int Distance(int i, int j) { return abs(x[j] - x[i]) + abs(y[j] - y[i]); }
void floyd() {
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (g[i][j] > g[i][k] + g[k][j] && i != j && j != k && i != k)
          g[i][j] = g[i][k] + g[k][j];
  cout << g[1][n] << endl;
}
int main() {
  cin >> n >> d;
  int ttt;
  for (int i = 2; i < n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  a[1] = a[n] = 0;
  for (int i = 1; i <= n; i++) {
    g[i][i] = 0;
    for (int j = i + 1; j <= n; j++) {
      g[i][j] = Distance(i, j) * d - a[j];
      g[j][i] = Distance(j, i) * d - a[i];
    }
  }
  floyd();
  return 0;
}
