#include <bits/stdc++.h>
using namespace std;
struct Station {
  int a, x, y;
  int dis;
  int extra;
};
int main() {
  int n, d;
  Station station[105];
  int map[105];
  memset(map, 0, 4 * 105);
  cin >> n >> d;
  station[0].a = 0;
  for (int i = 0; i < n - 2; i++) cin >> station[i + 1].a;
  for (int i = 0; i < n; i++) cin >> station[i].x >> station[i].y;
  for (int i = 1; i < n; i++) {
    station[i].dis = d * (abs(station[i].x - station[0].x) +
                          abs(station[i].y - station[0].y));
    station[i].extra = 0;
  }
  while (true) {
    int min = 100000000;
    int min_index = 0;
    for (int i = 1; i < n; i++) {
      if (map[i] == 1) continue;
      if (station[i].dis < min) {
        min = station[i].dis;
        min_index = i;
      } else if (station[i].dis == min) {
        if (station[i].a + station[i].extra >
            station[min_index].a + station[min_index].extra)
          min_index = i;
      }
    }
    map[min_index] = 1;
    if (min_index == n - 1) break;
    for (int i = 1; i < n; i++) {
      if (i == min_index) continue;
      int dis = d * (abs(station[i].x - station[min_index].x) +
                     abs(station[i].y - station[min_index].y));
      int buget = station[min_index].a + station[min_index].extra;
      int tmp_dis, tmp_extra;
      if (dis >= buget) {
        tmp_dis = station[min_index].dis + dis - buget;
        tmp_extra = 0;
      } else {
        tmp_dis = station[min_index].dis;
        tmp_extra = buget - dis;
      }
      if (tmp_dis < station[i].dis) {
        station[i].dis = tmp_dis;
        station[i].extra = tmp_extra;
      } else if (tmp_dis == station[i].dis) {
        if (tmp_extra > station[i].extra) station[i].extra = tmp_extra;
      }
    }
  }
  cout << station[n - 1].dis;
  return 0;
}
