#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int M = 100;
int cal(int t) { return (t >= 0 ? t : -t); }
int n, d, a[M + 5], x[M + 5], y[M + 5], dist[M + 5][M + 5];
int main() {
  scanf("%d %d", &n, &d);
  for (int i = 2; i < n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d %d", &x[i], &y[i]);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      dist[i][j] =
          (i == j ? 0 : cal(x[i] - x[j]) * d + cal(y[i] - y[j]) * d - a[j]);
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
  printf("%d", dist[1][n]);
}
