#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:128777216")
const int null = 0;
using namespace std;
template <class T>
int size(const T &a) {
  return int(a.size());
}
template <class T>
T abs(const T &a) {
  return (a < 0 ? -a : a);
}
template <class T>
T sqr(const T &a) {
  return a * a;
}
const int max_n = 100;
struct Point {
  int x, y;
  void scan() { scanf("%d %d", &x, &y); }
  int distanceTo(const Point &p) const { return abs(x - p.x) + abs(y - p.y); }
} p[max_n];
int w[max_n];
int a[max_n][max_n];
int main() {
  int n, d;
  scanf("%d %d", &n, &d);
  for (int i = 1; i < n - 1; i++) {
    scanf("%d", &w[i]);
  }
  for (int i = 0; i < n; i++) {
    p[i].scan();
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i != j) {
        a[i][j] = p[i].distanceTo(p[j]) * d - w[i];
      }
    }
  }
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (a[i][k] + a[k][j] < a[i][j]) {
          a[i][j] = a[i][k] + a[k][j];
        }
      }
    }
  }
  cout << a[0][n - 1] << endl;
  return 0;
}
