#include <bits/stdc++.h>
using namespace std;
int n, d;
struct POINT {
  int x, y;
} p[105];
int a[105];
long long mp[105][105];
int main(int argc, char* argv[]) {
  std::ios::sync_with_stdio(false);
  scanf("%d%d", &n, &d);
  for (int i = 2; i <= n - 1; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d%d", &p[i].x, &p[i].y);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      mp[i][j] = (abs(p[i].x - p[j].x) + abs(p[i].y - p[j].y)) * d - a[j];
    }
  }
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (mp[i][j] > mp[i][k] + mp[k][j]) mp[i][j] = mp[i][k] + mp[k][j];
  printf("%I64d\n", mp[1][n]);
  return 0;
}
