Yaroslav is playing a game called "Time". The game has a timer showing the lifespan he's got left. As soon as the timer shows 0, Yaroslav's character dies and the game ends. Also, the game has n clock stations, station number i is at point (x_{i}, y_{i}) of the plane. As the player visits station number i, he increases the current time on his timer by a_{i}. The stations are for one-time use only, so if the player visits some station another time, the time on his timer won't grow.

A player spends d·dist time units to move between stations, where dist is the distance the player has covered and d is some constant. The distance between stations i and j is determined as |x_{i} - x_{j}| + |y_{i} - y_{j}|.

Initially, the player is at station number 1, and the player has strictly more than zero and strictly less than one units of time. At station number 1 one unit of money can increase the time on the timer by one time unit (you can buy only integer number of time units).

Now Yaroslav is wondering, how much money he needs to get to station n. Help Yaroslav. Consider the time to buy and to increase the timer value negligibly small.


-----Input-----

The first line contains integers n and d (3 ≤ n ≤ 100, 10^3 ≤ d ≤ 10^5) — the number of stations and the constant from the statement.

The second line contains n - 2 integers: a_2, a_3, ..., a_{n} - 1 (1 ≤ a_{i} ≤ 10^3). The next n lines contain the coordinates of the stations. The i-th of them contains two integers x_{i}, y_{i} (-100 ≤ x_{i}, y_{i} ≤ 100).

It is guaranteed that no two stations are located at the same point.


-----Output-----

In a single line print an integer — the answer to the problem.


-----Examples-----
Input
3 1000
1000
0 0
0 1
0 3

Output
2000

Input
3 1000
1000
1 0
1 1
1 2

Output
1000

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "n, d = list(map(int, input().split()))\n\na = [0] + list(map(int, input().split())) + [0]      #aumento de timer según estación\nX = []\nY = []\n\nfor i in range(n):\n  x, y = list(map(int, input().split()))                 #Coordenadas de la estación i.\n  X.append(x) \n  Y.append(y)\n\nmon = [-1] * n                          #array para el monto necesario para llegar.\nmon[0] = 0\nZ = 0                                   #valor que permitirá entrar al loop\n\nwhile Z == 0:\n  Z = 1\n\n  for i in range(n):                                  #estamos en estación i\n\n    for j in range(1, n):                             #queremos ir a estación j\n\n      if i != j and mon[i] != -1:                      #si no queremos ir a la misma estación y donde estamos pudimos llegar.\n        costo = mon[i] + (abs(X[i] - X[j]) + abs(Y[i] - Y[j]))*d - a[j]         #nuevo costo necesario para ir de i a j.\n\n        if mon[j] == -1 or costo < mon[j]:          #si el nuevo costo es menor que uno anterior, se guarda este o si antes no había ningun costo guardado.\n          mon[j] = costo\n          Z = 0                              #volvemos a entrar al loop, esto asegura que todos los mon[] van a dejar de ser '1 y tendran un costo.\nprint(mon[-1])                               #costo de llegar a la última estación.\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13569