#include <bits/stdc++.h>
using namespace std;
int a[101];
int g[101][101];
bool vis[101];
pair<int, int> p[101];
const int inf = 1000000000;
int n, d;
int main(void) {
  cin >> n >> d;
  for (int i = 2; i <= n - 1; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  a[1] = a[n] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      g[i][j] = abs(p[i].first - p[j].first) + abs(p[i].second - p[j].second);
      g[i][j] *= d;
      if (i != j) g[i][j] -= a[j];
    }
  }
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) {
        g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
      }
  cout << g[1][n] << endl;
}
