#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100 + 10;
long long n, D, a[maxn];
long long d[maxn][maxn], x[maxn], y[maxn];
int main() {
  scanf("%I64d%I64d", &n, &D);
  for (int i = 2; i < n; i++) scanf("%I64d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%I64d%I64d", &x[i], &y[i]);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j) d[i][j] = (fabs(x[i] - x[j]) + fabs(y[i] - y[j])) * D - a[i];
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
  printf("%I64d\n", d[1][n]);
  return 0;
}
