#include <bits/stdc++.h>
using namespace std;
int const N = 1e2 + 10;
int n, d, a[N];
long long dis[N][N], x[N], y[N];
int main() {
  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("%I64d %I64d", &x[i], &y[i]);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j) dis[i][j] = d * (abs(x[i] - x[j]) + abs(y[i] - y[j])) - a[i];
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
  printf("%I64d\n", dis[1][n]);
}
