#include <bits/stdc++.h>
using namespace std;
int matr[201][201];
int times[201];
int points[201][201];
int N;
int D;
int dirs[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
int main() {
  scanf("%d%d", &N, &D);
  for (int i = 1; i < N - 1; i++) scanf("%d", &times[i]);
  times[0] = 0;
  times[N - 1] = 0;
  for (int i = 0; i < 201; i++)
    for (int j = 0; j < 201; j++) {
      points[i][j] = 0;
      matr[i][j] = 2000000000;
    }
  int sx, sy, fx, fy;
  for (int i = 0; i < N; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    if (i > 0) {
      if (i < N - 1)
        points[x + 100][y + 100] = times[i];
      else {
        fx = x + 100;
        fy = y + 100;
      }
    } else {
      sx = x + 100;
      sy = y + 100;
    }
  }
  matr[sx][sy] = 0;
  queue<int> q;
  q.push(sx * 201 + sy);
  while (!q.empty()) {
    int a = q.front();
    q.pop();
    int x = a / 201;
    int y = a % 201;
    for (int d = 0; d < 4; d++) {
      int xx = x + dirs[d][0];
      int yy = y + dirs[d][1];
      if (xx >= 0 && xx < 201 && yy >= 0 && yy < 201 &&
          matr[xx][yy] > matr[x][y] + D - points[xx][yy]) {
        matr[xx][yy] = matr[x][y] + D - points[xx][yy];
        q.push(xx * 201 + yy);
      }
    }
  }
  printf("%d\n", matr[fx][fy]);
  return 0;
}
