The bear decided to store some raspberry for the winter. He cunningly found out the price for a barrel of honey in kilos of raspberry for each of the following n days. According to the bear's data, on the i-th (1 ≤ i ≤ n) day, the price for one barrel of honey is going to is x_{i} kilos of raspberry.

Unfortunately, the bear has neither a honey barrel, nor the raspberry. At the same time, the bear's got a friend who is ready to lend him a barrel of honey for exactly one day for c kilograms of raspberry. That's why the bear came up with a smart plan. He wants to choose some day d (1 ≤ d < n), lent a barrel of honey and immediately (on day d) sell it according to a daily exchange rate. The next day (d + 1) the bear wants to buy a new barrel of honey according to a daily exchange rate (as he's got some raspberry left from selling the previous barrel) and immediately (on day d + 1) give his friend the borrowed barrel of honey as well as c kilograms of raspberry for renting the barrel.

The bear wants to execute his plan at most once and then hibernate. What maximum number of kilograms of raspberry can he earn? Note that if at some point of the plan the bear runs out of the raspberry, then he won't execute such a plan.


-----Input-----

The first line contains two space-separated integers, n and c (2 ≤ n ≤ 100, 0 ≤ c ≤ 100), — the number of days and the number of kilos of raspberry that the bear should give for borrowing the barrel.

The second line contains n space-separated integers x_1, x_2, ..., x_{n} (0 ≤ x_{i} ≤ 100), the price of a honey barrel on day i.


-----Output-----

Print a single integer — the answer to the problem.


-----Examples-----
Input
5 1
5 10 7 3 20

Output
3

Input
6 2
100 1 10 40 10 40

Output
97

Input
3 0
1 2 3

Output
0



-----Note-----

In the first sample the bear will lend a honey barrel at day 3 and then sell it for 7. Then the bear will buy a barrel for 3 and return it to the friend. So, the profit is (7 - 3 - 1) = 3.

In the second sample bear will lend a honey barrel at day 1 and then sell it for 100. Then the bear buy the barrel for 1 at the day 2. So, the profit is (100 - 1 - 2) = 97.

Difficulty: EASY

Solutions:
(n, c) = map(int, input().split())
arr = list(map(int, input().split()))
res = c
for i in range(n - 1):
	res = max(res, arr[i] - arr[i + 1])
res = max(0, res - c)
print(res)


(n, c) = map(int, input().split())
x = list(map(int, input().split()))
ma = 0
for i in range(0, n - 1):
	ma = max(ma, x[i] - x[i + 1] - c)
print(ma)


a = int(input().split()[1])
s = input().split()
d = []
for i in range(len(s) - 1):
	d.append(int(s[i]) - int(s[i + 1]))
n = max(d) - a
if n <= 0:
	print(0)
else:
	print(n)


(n, c) = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
r = 0
for i in range(n - 1):
	if c < x[i] and x[i] > x[i + 1]:
		if x[i] - x[i + 1] > r:
			r = x[i] - x[i + 1]
if r < c:
	print(0)
else:
	print(r - c)


s = input('')
(n, c) = s.split(' ')
n = int(n)
c = int(c)
s1 = input('')
l = s1.split(' ')
l1 = []
l = list(map(int, l))
for i in range(n - 1):
	if l[i + 1] < l[i]:
		l1.append(l[i] - l[i + 1])
if len(l1) == 0:
	print('0')
elif c > max(l1):
	print('0')
else:
	print(max(l1) - c)


(n, b) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
for i in range(n - 1):
	ans = max(ans, l[i] - l[i + 1] - b)
print(ans)


(n, c) = [v for v in map(int, input().split())]
p = [v for v in map(int, input().split())]
profit = lambda i: p[i] - p[i + 1] - c
max_profit = 0
for i in range(n - 1):
	pr = profit(i)
	if pr > max_profit:
		max_profit = pr
print(max_profit)


temp = input()
temp = temp.split()
n = int(temp[0])
c = int(temp[1])
price = input()
price = price.split()
price = [int(x) for x in price]
difference = 0
index = 0
for x in range(len(price) - 1):
	if price[x] - price[x + 1] > difference:
		index = x
		difference = price[x] - price[x + 1]
if difference == 0:
	print('0')
elif price[index] - price[index + 1] - c >= 0:
	print(price[index] - price[index + 1] - c)
else:
	print('0')


(n, c) = map(int, input().split())
a = list(map(int, input().split()))
t = 0
for i in range(n - 1):
	t = max(t, a[i] - a[i + 1] - c)
print(max(t, 0))


(n, c) = map(int, input().split())
x = list(map(int, input().split()))
a = []
for i in range(n - 1):
	a.append(x[i] - x[i + 1] - c)
print(max(a) if max(a) > 0 else 0)


(n, c) = list(map(int, input().split()))
x = list(map(int, input().split()))
profit = [x[i] - c - x[i + 1] for i in range(len(x) - 1)]
print(max(0, max(profit)))


(n, c) = list(map(int, input().split()))
p = list(map(int, input().split()))
m = 0
for i in range(n - 1):
	if p[i] > p[i + 1]:
		m = max(m, p[i] - p[i + 1] - c)
print(m)


(n, c) = input().split(' ')
n = int(n)
c = int(c)
max = 0
a = input().split(' ')
for i in range(n):
	a[i] = int(a[i])
for i in range(n - 1):
	if a[i] - a[i + 1] - c > 0:
		if a[i] - a[i + 1] - c > max:
			max = a[i] - a[i + 1] - c
print(max)


(n, b) = list(map(int, input().split()))
x = list(map(int, input().split()))
ans = []
for i in range(n - 1):
	if x[i] >= x[i + 1]:
		ans.append(x[i] - x[i + 1])
if len(ans) == 0:
	print(0)
else:
	ans = max(ans) - b
	if ans <= 0:
		print(0)
	else:
		print(ans)


(n, c) = list(map(int, input().split()))
price = list(map(int, input().split()))
profit = 0
for i in range(len(price) - 1):
	t = price[i] - price[i + 1] - c
	if t > profit:
		profit = t
print(profit)


(n, c) = str(input()).split()
n = int(n)
c = int(c)
line = str(input()).split()
line = [int(it) for it in line]
tar = 0
for i in range(n - 1):
	tar = max(line[i] - line[i + 1], tar)
print(max(tar - c, 0))


(n, k) = map(int, input().split())
a = list(map(int, input().strip().split()))
b = []
for _ in range(len(a) - 1):
	b.append(a[_] - a[_ + 1])
print(max(b) - k if max(b) - k > 0 else 0)


(a, b) = map(int, input().split())
s = list(map(int, input().split()))
x = 0
razn = 0
for i in range(a - 1):
	if s[i] > s[i + 1]:
		x = s[i] - s[i + 1]
		razn = max(razn, x)
print(max(razn - b, 0))


import sys
(n, c) = map(int, sys.stdin.readline().split())
x = list(map(int, sys.stdin.readline().split()))
a = max([x[i] - x[i + 1] for i in range(n - 1)])
print(max(a - c, 0))


a = []
a = input().split()
n = int(a[0])
c = int(a[1])
x = []
x = input().split()
for i in range(0, n, 1):
	x[i] = int(x[i])
profit = []
for i in range(0, n - 1, 1):
	p = x[i] - x[i + 1] - c
	if p > 0:
		profit.append(p)
	else:
		profit.append(0)
print(max(profit))


(n, c) = map(int, input().split())
m = 0
l = list(map(int, input().split()))
for i in range(n - 1):
	m = max(m, l[i] - l[i + 1] - c)
print(m)


def inp():
	return input()

def si():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def solve():
	(n, m) = mi()
	arr = li()
	ans = 0
	for i in range(1, n):
		ans = max(ans, arr[i - 1] - arr[i] - m)
	print(ans)
solve()


(n, c) = map(int, input().split())
ll = list(map(int, input().split()))
ll1 = []
for i in range(n - 1):
	ll1.append(ll[i] - ll[i + 1] - c)
if max(ll1) <= 0:
	print(0)
else:
	print(max(ll1))


(n, c) = map(int, input().split())
a = [int(x) for x in input().split()]
t = 0
for i in range(n - 1):
	if t < a[i] - a[i + 1]:
		t = a[i] - a[i + 1]
if t == 0 or t < c:
	print(0)
else:
	print(t - c)


(n, c) = map(int, input().split())
arr = list(map(int, input().split()))
max = 0
for i in range(1, len(arr)):
	if arr[i - 1] - arr[i] > max:
		max = arr[i - 1] - arr[i]
print(max - c) if max - c > 0 else print(0)


arr1 = input().split(' ')
days = int(arr1[0])
kilos = int(arr1[1])
raspberryMaxVal = 0
prices = input().split(' ')
kilos = int(kilos)
days = int(days)
for i in range(0, days - 1):
	currentVal = int(prices[i]) - int(prices[i + 1]) - kilos
	if currentVal < 0:
		continue
	elif currentVal > raspberryMaxVal:
		raspberryMaxVal = currentVal
print(raspberryMaxVal)


(n, c) = input().split(' ')
n = int(n)
c = int(c)
x = [int(i) for i in input().split(' ')]
f = False
old = x[0]
answer = 0
for new in x:
	if f == False:
		f = True
	answer = max(answer, old - new - c)
	old = new
if answer < 0:
	print(answer)
	exit(0)
print(answer)


(n, c) = map(int, input().split())
ans = 0
l1 = list(map(int, input().split()))
for i in range(n - 1):
	ans = max(ans, l1[i] - l1[i + 1] - c)
print(ans)


(n, c) = map(int, input().split())
a = [int(i) for i in input().split()]
maxr = 0
ind = 0
for i in range(n - 1):
	if a[i] - a[i + 1] > maxr and a[i] - a[i + 1] - c > 0:
		maxr = a[i] - a[i + 1]
if maxr - c > 0:
	print(maxr - c)
else:
	print(0)


(n, c) = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
for i in range(n - 1):
	x[i] = x[i] - x[i + 1]
ans = max(x[:-1]) - c
if ans > 0:
	print(ans)
else:
	print(0)


(d, c) = map(int, input().split())
m = 0
ds = list(map(int, input().split()))
for i in range(d - 1):
	m = max(ds[i] - ds[i + 1], m)
if m - c > 0:
	print(m - c)
else:
	print(0)


(n, c) = list(map(int, input().split()))
A = list(map(int, input().split()))
best = 0
for i in range(n - 1):
	if A[i] - A[i + 1] > best:
		best = A[i] - A[i + 1]
print(max(0, best - c))


I = [int(i) for i in input().split()]
(n, c) = (I[0], I[1])
I = [int(i) for i in input().split()]
I_new = []
for i in range(1, n):
	I_new.append(I[i - 1] - I[i])
I_new.sort()
ans = I_new[-1] - c
if ans < 0:
	print(0)
else:
	print(ans)


(n, c) = map(int, input().split())
x = list(map(int, input().split()))
max_diff = -999999
for i in range(n - 1):
	if x[i] - x[i + 1] > max_diff:
		max_diff = x[i] - x[i + 1]
res = max_diff - c
if res < 0:
	res = 0
print(res)


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
m = int(0)
for i in range(a - 1):
	if m < l[i] - l[i + 1] - b:
		m = l[i] - l[i + 1] - b
print(m)


(n, c) = map(int, input().split(' '))
l = input().split(' ')
l = [int(x) for x in l]
max = 0
m = 0
for i in range(n - 1):
	if l[i] - l[i + 1] > max:
		max = l[i] - l[i + 1]
		m = i
if max - c > 0:
	print(max - c)
else:
	print(0)


(n, v) = map(int, input().split())
l = list(map(int, input().split()))
ma = 0
for i in range(n - 1):
	if l[i] - v - l[i + 1] > ma:
		ma = l[i] - v - l[i + 1]
print(ma)


(n, c) = map(int, input().split())
x = list(map(int, input().split()))
l = []
for i in range(n - 1):
	l.append(x[i] - x[i + 1] - c)
l.append(0)
print(max(l))


(n, c) = map(int, input().strip().split())
arr = list(map(int, input().strip().split()))
ind = -1
maxi = 0
for i in range(n - 1):
	if arr[i] - arr[i + 1] > maxi:
		ind = i
		maxi = arr[i] - arr[i + 1]
if ind == -1:
	print(0)
else:
	print(max(0, arr[ind] - arr[ind + 1] - c))


def main():
	readData = lambda : map(int, input().split())
	(n, c) = readData()
	X = list(readData())
	ret = 0
	for i in range(n - 1):
		ret = max(ret, X[i] - X[i + 1] - c)
	print(ret)
main()


(n, c) = map(int, input().split())
l = list(map(int, input().split()))
d = []
for i in range(len(l) - 1):
	d.append(l[i] - l[i + 1] - c)
if max(d) > 0:
	print(max(d))
else:
	print('0')


(n, c) = list(map(int, input().split()))
arr = [int(i) for i in input().split()]
(i, r) = (0, 0)
for i in range(n - 1):
	if arr[i] - arr[i + 1] - c > r:
		r = arr[i] - arr[i + 1] - c
print(r)


def max_raspberry(n_days: int, lend_price: int, honey_prices: list) -> int:
	money = max((honey_prices[i] - honey_prices[i + 1] for i in range(n_days - 1)))
	if money < lend_price:
		return 0
	return money - lend_price
(n, c) = map(int, input().split())
x = [int(i) for i in input().split()]
print(max_raspberry(n, c, x))


l1 = [int(x) for x in input().split()]
(n, interest) = (l1[0], l1[1])
l2 = [int(x) for x in input().split()]
profits = [0]
for x in range(n - 1):
	targ = l2[x]
	profits.append(targ - l2[x + 1] - interest)
if max(profits) > 0:
	print(max(profits))
else:
	print(0)


(n, c) = (int(x) for x in input().split())
p = [int(x) for x in input().split()]
val = 0
for i in range(1, n):
	cur = p[i - 1] - p[i] - c
	if cur > val:
		val = cur
print(val)


(X, Max, Days) = (list(map(int, input().split())), 0, list(map(int, input().split())))
for i in range(X[0] - 1):
	Max = max(Max, Days[i] - Days[i + 1])
print(max(Max - X[1], 0))


n = list(map(int, input().split()))
m = list(map(int, input().split()))
c = []
for i in range(len(m) - 1):
	ci = m[i] - m[i + 1]
	c.append(ci)
max_i = max(c)
max_m = max(max_i - n[1], 0)
print(max_m)


(n, c) = input().split()
(n, c) = (int(n), int(c))
lista = list(map(int, input().split()))
rasp = 0
inferno = []
guloso = 0
for x in range(len(lista) - 1):
	if lista[x] - c - lista[x + 1] >= guloso:
		guloso = lista[x] - c - lista[x + 1]
print(guloso)


(n, c) = map(int, input().split())
l = list(map(int, input().split()))
m = l[0] - l[1]
for i in range(1, n - 1):
	v = l[i] - l[i + 1]
	if v > m:
		m = v
d = m - c
print(d if d > 0 else 0)


(n, c) = map(int, input().split())
s = list(map(int, input().split()))
diff = 0
for i in range(n - 1):
	if s[i] - s[i + 1] > diff:
		diff = s[i] - s[i + 1]
if diff - c > 0:
	print(diff - c)
else:
	print(0)


(n, c) = map(int, input().split())
pric = [int(x) for x in input().split()]
diff = (pric[i - 1] - pric[i] for i in range(1, n))
print(max(0, max(diff) - c))


(x, y) = map(int, input().split())
li = list(map(int, input().split()))
max1 = 0
for i in range(x - 1):
	if max1 < li[i] - li[i + 1]:
		max1 = li[i] - li[i + 1]
if max1 - y >= 0:
	print(max1 - y)
else:
	print(0)


n = input()
n = n.split()
n[0] = int(n[0])
n[1] = int(n[1])
x = input()
x = x.split()
res = [0]
for i in range(n[0]):
	x[i] = int(x[i])
for i in range(n[0] - 1):
	if x[i] > x[i + 1]:
		res.append(x[i] - x[i + 1] - n[1])
print(max(res))


(N, C) = map(int, input().split())
X = list(map(int, input().split()))
ans = -1
for i in range(N - 1):
	ans = max(ans, X[i] - X[i + 1] - C)
if ans < 0:
	ans = 0
print(ans)


(n, c) = [int(x) for x in input().split()]
prices = [int(x) for x in input().split()]
dif = prices[0] - prices[1]
for i in range(n - 1):
	if prices[i] - prices[i + 1] > dif:
		dif = prices[i] - prices[i + 1]
print(max(0, dif - c))


try:
	(n, c) = map(int, input().split())
	k = [int(i) for i in input().split()]
	a = []
	for i in range(n - 1):
		if k[i] <= k[i + 1]:
			a.append(0)
		else:
			a.append(k[i] - k[i + 1])
	if max(a) == 0 or max(a) < c:
		print(0)
	else:
		print(max(a) - c)
except:
	pass


x = input().split(' ')
array = input().split(' ')
friend = int(x[1])
possible = False
diff = 0
i = 1
while i < len(array):
	temp = int(array[i - 1]) - int(array[i])
	if temp > diff:
		diff = temp
		possible = True
	i += 1
if not possible:
	print(0)
elif diff - friend <= 0:
	print(0)
else:
	print(diff - friend)


val = [int(n) for n in input().split()]
n = val[0]
c = val[1]
days = [int(n) for n in input().split()]
result = 0
for i in range(1, n):
	if days[i - 1] > days[i]:
		result = max(result, days[i - 1] - days[i] - c)
print(result)


[n, c] = [int(x) for x in input().split(' ')]
l = [int(x) for x in input().split(' ')]
maxrasp = 0
for i in range(len(l)):
	if i != len(l) - 1 and l[i] - l[i + 1] > maxrasp:
		maxrasp = l[i] - l[i + 1]
k = maxrasp - c
if k < 0:
	print(0)
else:
	print(k)


(n, c) = map(int, input().split())
array = list(map(int, input().split()))
a = [0]
for i in range(n - 1):
	if array[i] < array[i + 1]:
		continue
	elif array[i] == array[i + 1]:
		continue
	else:
		d = array[i] - array[i + 1]
		a.append(d)
if max(a) >= c:
	print(max(a) - c)
else:
	print('0')


import sys

def main():
	(n, c) = map(int, sys.stdin.readline().strip().split())
	a = list(map(int, sys.stdin.readline().strip().split()))
	m = 0
	for i in range(len(a) - 1):
		r = a[i] - a[i + 1] - c
		m = max(m, r)
	print(m)
main()


(n, c) = map(int, input().split())
v = list(map(int, input().split()))
ret = 0
for i in range(n - 1):
	ret = max(ret, v[i] - v[i + 1] - c)
print(ret)


(a, b) = map(int, input().split())
L = list(map(int, input().split()))
L = list(zip(L[:a - 1], L[1:]))
maxi = 0
for k in L:
	valor = k[0] - k[1] - b
	if valor > maxi:
		maxi = valor
print(maxi)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
b = sorted(a)
max1 = 0
if a == b:
	print(0)
else:
	for i in range(0, n - 1):
		max1 = max(max1, a[i] - a[i + 1] - k)
	print(max1)


(n, c) = map(int, input().split())
l = list(map(int, input().split()))
length = len(l)
max_r = 0
for i in range(length - 1):
	if l[i] - l[i + 1] > max_r:
		max_r = l[i] - l[i + 1]
if max_r > c:
	print(max_r - c)
else:
	print(0)


def bear(lst, c):
	result = 0
	for i in range(len(lst)):
		if i > 0 and lst[i - 1] - lst[i] - c > result:
			result = lst[i - 1] - lst[i] - c
	return result
(n, C) = [int(j) for j in input().split()]
a = [int(x) for x in input().split()]
print(bear(a, C))


(n, c) = map(int, input().split())
x = list(map(int, input().split()))
y = []
for a in range(len(x) - 1):
	y.append(abs(x[a]) - abs(x[a + 1]))
maxi = y.index(max(y))
if x[maxi] - x[maxi + 1] - c <= 0:
	print(0)
else:
	print(x[maxi] - x[maxi + 1] - c)


(n, c) = map(int, input().split())
days = list(map(int, input().split()))
MAX = [0]
for i in range(len(days)):
	if i != len(days) - 1:
		if days[i + 1] < days[i]:
			MAX.append(days[i] - days[i + 1] - c)
print(max(MAX))


(n, c) = map(int, input().split())
a = list(map(int, input().split()))
res = 0
for i in range(n - 1):
	diff = a[i] - a[i + 1]
	if diff >= 0:
		res = max(diff, res)
ans = res - c
if res - c < 0:
	print(0)
else:
	print(res - c)


(n, c) = input().split()
n = int(n)
c = int(c)
l = list(map(int, input().split()))
mx = -100000
for i in range(n - 1):
	if l[i] > l[i + 1] and l[i] - l[i + 1] > mx:
		mx = l[i] - l[i + 1]
s = mx - c
print(s if s > 0 else 0)


I = lambda : map(int, input().split())
(n, c) = I()
a = [*I()]
print(max(0, *[x - y - c for (x, y) in zip(a, a[1:])]))


a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = []
for i in range(len(b) - 1):
	c.append(b[i] - b[i + 1])
if max(c) - a[1] > 0:
	print(max(c) - a[1])
else:
	print(0)


s = [int(i) for i in input().split(' ')]
n = s[0]
c = s[1]
a = [int(i) for i in input().split(' ')]
k = -1
for i in range(n - 1):
	if a[i] - a[i + 1] > k:
		k = a[i] - a[i + 1]
if k == -1 or k - c < 0:
	print(0)
else:
	print(k - c)


import math

def solve(arr, n, c):
	mx = -math.inf
	for i in range(1, n):
		mx = max(mx, arr[i - 1] - arr[i])
	if mx > c:
		return mx - c
	else:
		return 0
(n, c) = list(map(int, input().strip().split()))
arr = list(map(int, input().strip().split()))
result = solve(arr, n, c)
print(result)


def get_int():
	return map(int, input().split())
(n, c) = get_int()
x = list(get_int()) + [1000]
print(max(0, max([x[i] - x[i + 1] for i in range(len(x) - 1)]) - c))


def solve(lst, n):
	pass
(n, p) = map(int, input().split())
lst = list(map(int, input().split(' ')))
ans = -21828918921
for i in range(len(lst) - 1):
	ans = max(lst[i] - lst[i + 1] - p, ans)
if ans < 0:
	print(0)
else:
	print(ans)


(y, x) = list(map(int, input().split()))
nums = list(map(int, input().split()))
ans = 0
for i in range(1, len(nums)):
	ans = max(ans, nums[i - 1] - nums[i] - x)
print(ans)


import math

def ost(a, b):
	if a % b != 0:
		return 1
	return 0
(n, k) = map(int, input().split())
ans = 0
data = list(map(int, input().split()))
for i in range(n - 1):
	if data[i] - data[i + 1] - k > 0 and data[i] - data[i + 1] - k > ans:
		ans = data[i] - data[i + 1] - k
print(ans)


(n, c) = map(int, input().split())
l = list(map(int, input().split()))
mx = -100
for i in range(n - 1):
	x = l[i] - l[i + 1] - c
	mx = max(mx, x)
if mx > 0:
	print(mx)
else:
	print(0)


inpt = [int(item) for item in input().split()]
x = [int(item) for item in input().split()]
newlist = []
for item in range(inpt[0] - 1):
	if x[item] - x[item + 1] > 0:
		newlist.append((x[item] - x[item + 1], item))
	else:
		pass
newlist.sort(reverse=True)
if len(newlist) == 0:
	print(0)
elif x[newlist[0][1]] - inpt[1] - x[newlist[0][1] + 1] > 0:
	print(x[newlist[0][1]] - inpt[1] - x[newlist[0][1] + 1])
else:
	print(0)


(n, s) = map(int, input().split())
l = list(map(int, input().split()))
r = -1
for i in range(1, n):
	if l[i] < l[i - 1]:
		p = l[i - 1] - l[i] - s
		r = max(r, p)
if r > 0:
	print(r)
else:
	print(0)


s = input().rstrip().split(' ')
(n, c) = (int(s[0]), int(s[1]))
x = input().rstrip().split(' ')
max = int(x[0]) - int(x[1]) - c
for i in range(1, n - 1):
	if int(x[i]) - int(x[i + 1]) - c > max:
		max = int(x[i]) - int(x[i + 1]) - c
if max < 0:
	max = 0
print(max)


(n, c) = map(int, input().split())
a = list(map(int, input().split()))
maxi = 0
for i in range(n - 1):
	if a[i] - a[i + 1] - c > maxi:
		maxi = a[i] - a[i + 1] - c
else:
	print(maxi)


(n, c) = list(map(int, input().rstrip().split()))
x = list(map(int, input().rstrip().split()))
out = 0
for i in range(n - 1):
	if x[i] > x[i + 1]:
		prof = x[i] - x[i + 1] - c
		out = max(out, prof)
print(out)


(n, c) = map(int, input().split())
k = list(map(int, input().split()))
l = []
for i in range(n - 1):
	l.append(k[i] - k[i + 1] - c)
h = max(l)
if h > 0:
	print(h)
else:
	print('0')


(n, c) = map(int, input().split())
l = list(map(int, input().split()))
ma = c
for i in range(1, n):
	t = l[i - 1] - l[i]
	if ma < t:
		ma = t
print(ma - c)


(n, c) = map(int, input().split())
x = [int(n) for n in input().split()]
profit = 0
day = 0
for i in range(n - 1):
	p = x[i] - x[i + 1] - c
	if p > profit:
		profit = p
		day = i
print(profit)


(a, b) = map(int, input().split())
list1 = [int(h) for h in input().split()]
list2 = []
for i in range(0, a - 1):
	list2.append(list1[i] - list1[i + 1])
d = max(list2) - b
if d < 0:
	print(0)
else:
	print(d)


import logging
import copy
import sys
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)

def solve(firstLine, inputLines):
	m = 0
	x = firstLine[1]
	for i in range(len(inputLines) - 1):
		s = inputLines[i] - inputLines[i + 1] - x
		if s > m:
			m = s
	return m

def main():
	firstLine = input().split()
	firstLine = list(map(int, firstLine))
	line = input().split()
	line = list(map(int, line))
	print(solve(firstLine, line))

def log(*message):
	logging.debug(message)
main()


def main():
	(n, c) = map(int, input().split())
	l = list(map(int, input().split()))
	print(max(0, max((a - b for (a, b) in zip(l, l[1:]))) - c))
main()


(n, c) = list(map(int, input().split()))
x = list(map(int, input().split()))
profit = 0
for i in range(n - 1):
	daily = x[i] - x[i + 1] - c
	if daily > profit:
		profit = daily
print(profit)


n = input().split()
x = input().split()
mx = 0
for i in range(0, len(x) - 1):
	jlh = int(x[i]) - int(x[1 + i]) - int(n[1])
	if jlh > mx:
		mx = jlh
print(mx)


def barrel_to_honey(n, c, a):
	biggest = 0
	for x in range(n - 1):
		if a[x] - (a[x + 1] + c) > biggest:
			biggest = a[x] - (a[x + 1] + c)
	return biggest
(n, c) = list(map(int, input().split()))
a = list(map(int, input().split()))
print(barrel_to_honey(n, c, a))


import sys
import math as m

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l
mod = int(1000000000.0) + 7

def sinp():
	return sys.stdin.readline().strip()

def iinp():
	return int(input())

def ninp():
	return map(int, sys.stdin.readline().strip().split())

def linp():
	return list(map(int, sys.stdin.readline().strip().split()))

def p(a):
	print(a)

def p2(a, b):
	print(a, b)
(n, c) = ninp()
x = linp()
diff = -23423
for i in range(n - 1):
	diff = max(diff, x[i] - x[i + 1])
if diff - c <= 0:
	print(0)
else:
	print(diff - c)


(n, c) = map(int, input().split())
data = list(map(int, input().split()))
val = 0
for i in range(n - 1):
	val = max(val, data[i] - data[i + 1])
print(max(0, val - c))


(n, c) = [int(i) for i in input().split()]
kiloDays = [int(i) for i in input().split()]
maxKilos = 0
for i in range(0, n - 1):
	maxKilos = max(maxKilos, kiloDays[i] - kiloDays[i + 1] - c)
print(maxKilos)


import sys
inp = sys.stdin
(n, c) = map(int, inp.readline().split())
x = list(map(int, inp.readline().split()))
maxProfit = 0
i = 0
while i < len(x) - 1:
	profit = x[i] - x[i + 1] - c
	if profit > maxProfit:
		maxProfit = profit
	i += 1
print(maxProfit)


def beer(lst, k):
	result = 0
	for i in range(len(lst)):
		if i > 0:
			result = max(result, lst[i - 1] - lst[i] - k)
	return result
(n, c) = [int(i) for i in input().split()]
a = [int(j) for j in input().split()]
print(beer(a, c))


import sys
(n, c) = map(int, input().split())
a = list(map(int, input().split()))
maxi = 0
p = -1
r = -1
for i in range(0, n - 1):
	if maxi < a[i] - a[i + 1]:
		maxi = a[i] - a[i + 1]
		p = i + 1
if maxi - c <= 0:
	print(0)
else:
	print(maxi - c)


(N, c) = map(int, input().split())
A = list(map(int, input().split()))
cur = None
for i in range(1, len(A)):
	if cur == None:
		cur = A[i - 1] - A[i]
	else:
		cur = max(cur, A[i - 1] - A[i])
if cur == None or cur - c < 0:
	print(0)
else:
	print(cur - c)


MAX = 0
(n, c) = map(int, input().split())
kurs_kg = [int(i) for i in input().split()]
for i in range(1, n):
	if MAX < kurs_kg[i - 1] - kurs_kg[i] - c:
		MAX = kurs_kg[i - 1] - kurs_kg[i] - c
print(MAX)


(n, c) = map(int, input().split())
nl = list(map(int, input().split()))
M = 0
for i in range(n - 1):
	diff = nl[i] - nl[i + 1]
	if diff > 0:
		diff -= c
		if diff > M:
			M = diff
print(M)


from collections import Counter
(n, c) = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
m = -1000
for i in range(n - 1):
	d = arr[i] - arr[i + 1]
	if d > m:
		m = d
profit = m - c
if profit > 0:
	print(profit)
else:
	print(0)


from sys import stdin, stdout
input = stdin.readline
(n, c) = map(int, input().split())
x = list(map(int, input().split()))
ma = x[0] - x[1]
for i in range(2, n):
	ma = max(x[i - 1] - x[i], ma)
stdout.write(str(max(0, ma - c)))


(n, c) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
p = []
for i in range(n - 1):
	z = a[i]
	o = a[i + 1]
	h = z - o
	p.append(h - c)
print(max(max(p), 0))


(n, c) = map(int, input().split())
k = list(map(int, input().split()))
max = 0
for i in range(len(k) - 1):
	if k[i] > c:
		if k[i] - c - k[i + 1] > 0:
			t = k[i] - c - k[i + 1]
			if t > max:
				max = t
print(max)


(n, c) = map(int, input().split())
x = list(map(int, input().split()))
sell_day = 0
buy_day = 0
max = float('-inf')
for i in range(n - 1):
	if max < x[i] - x[i + 1]:
		max = x[i] - x[i + 1]
		sell_day = i
		buy_day = i + 1
profit = x[sell_day] - x[buy_day] - c
if profit > 0:
	print(profit)
else:
	print(0)


res = 0
(n, m) = map(int, input().split())
t = list(map(int, input().split()))
for i in range(n - 1):
	if t[i] > t[i + 1] + m:
		res = max(res, t[i] - t[i + 1] - m)
print(res)


(n, c) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
for i in range(n - 1):
	d = l[i] - l[i + 1] - c
	ans = max(ans, d)
print(ans)


[n, c] = input().split()
maxof = 0
c = int(c)
g = input().split()
for i in range(1, int(n)):
	h = int(g[i - 1])
	k = int(g[i])
	if maxof < h - k - c:
		maxof = h - k - c
print(maxof)


import sys
n_borrow = sys.stdin.readline().split()
n = int(n_borrow[0])
borrow = int(n_borrow[1])
lista = sys.stdin.readline().split()
for i in range(n):
	lista[i] = int(lista[i])
mayordif = 0
for i in range(n - 1):
	aux = lista[i] - lista[i + 1]
	if aux > mayordif:
		mayordif = aux
if mayordif == 0:
	print(0)
elif mayordif < borrow:
	print(0)
else:
	print(mayordif - borrow)


(x, y) = input().split()
(a, b) = (int(x), int(y))
list = []
list1 = []
list = [int(x) for x in input().split()]
for j in range(a):
	try:
		x = list[j] - list[j + 1] - b
	except:
		break
	if x > 0:
		list1.append(x)
list1.append(0)
print(max(list1))


a = [int(i) for i in input().split()]
n = a[0]
c = a[1]
m = -1000000000
x = [int(i) for i in input().split()]
for i in range(n - 1):
	if x[i] - x[i + 1] > m:
		m = x[i] - x[i + 1]
if m >= c:
	print(m - c)
else:
	print(0)


(n, d) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
for i in range(n):
	ele = l[i]
	for j in range(i + 1, i + 2):
		if j != i and j < n:
			ans = max(ans, ele - l[j] - d)
print(ans)


def read():
	(n, x) = map(int, input().split())
	a = list(map(int, input().split()))
	return (n, x, a)

def solve(n, x, a):
	p = 0
	for i in range(n - 1):
		pi = a[i] - a[i + 1] - x
		p = max(p, pi)
	return p
result = solve(*read())
print(result)


(n, c) = map(int, input().split())
arr = list(map(int, input().split()))
print(max(0, max(map(lambda x: x[0] - x[1], zip([0] + arr[:-1], arr))) - c))


(n, c) = map(int, input().split())
x = list(map(int, input().split()))
counter = 0
for i in range(n - 1):
	if x[i] - x[i + 1] > counter:
		counter = x[i] - x[i + 1]
print(max(counter - c, 0))


(n, c) = map(int, input().split())
a = list(map(int, input().split()))
m = int(0)
for i in range(n - 1):
	x = a[i] - a[i + 1] - c
	m = max(m, x)
print(m)


(x, y) = map(int, input().split())
li = list(map(int, input().split()))
print(max(0, max([li[i] - li[i + 1] - y for i in range(x - 1)])))


(nod, extra) = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
maxp = 0
for i in range(1, nod):
	maxp = max(maxp, arr[i - 1] - arr[i] - extra)
print(maxp)


(n, c) = [int(x) for x in input().split()]
numbers = [int(x) for x in input().split()]
profit = 0
for i in range(0, n - 1):
	if numbers[i] - numbers[i + 1] - c > profit:
		profit = numbers[i] - numbers[i + 1] - c
print(profit)


(n, c) = map(int, input().strip().split())
xs = list(map(int, input().strip().split()))
ans = 0
for (i, j) in zip(xs, xs[1:]):
	ans = max(ans, i - j - c)
print(ans)


line1 = [int(i) for i in str(input()).split(' ')]
prices = [int(i) for i in str(input()).split(' ')]
rent = []
for i in range(1, len(prices)):
	rent.append(prices[i - 1] - prices[i] - line1[1])
if max(rent) > 0:
	print(max(rent))
else:
	print(0)


(n, c) = map(int, input().split())
X = list(map(int, input().split()))
print(max(0, max((X[i] - X[i + 1] for i in range(n - 1))) - c))


(n, t) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
diff = -1
for i in range(n - 1):
	if a[i] - a[i + 1] > diff:
		diff = a[i] - a[i + 1]
if diff > 0 and diff > t:
	print(diff - t)
else:
	print(0)


l = input().split(' ')
n = int(l[0])
c = int(l[1])
str_arr = input().split()
arr = [int(num) for num in str_arr]
max_diff = arr[0] - arr[1]
idx = 0
for i in range(1, len(arr) - 1):
	diff = arr[i] - arr[i + 1]
	if diff > 0 and diff > max_diff:
		max_diff = diff
		idx = i
ans = arr[idx] - arr[idx + 1] - c
if max_diff < 0 or ans < 0:
	print('0')
else:
	print(ans)


(n, k) = map(int, input().split())
max = 0
tmp = 0
x = list(map(int, input().split()))
for i in range(n - 1):
	if x[i] > x[i + 1] + k:
		tmp = x[i] - (x[i + 1] + k)
	if tmp > max:
		max = tmp
print(max)


(n, c) = list(map(int, input().split()))
data = list(map(int, input().split()))
profit = [0]
for i in range(len(data) - 1):
	if data[i] > data[i + 1]:
		profit.append(data[i] - data[i + 1] - c)
print(max(profit))


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
k = 0
for i in range(n - 1):
	if l[i] > l[i + 1] + m:
		if k < l[i] - l[i + 1] - m:
			k = l[i] - l[i + 1] - m
print(k)


(n, c) = map(int, input().split())
(last, best) = (-1, 0)
for x in map(int, input().split()):
	t = last - x - c
	best = max(best, t)
	last = x
print(best)


(n, c) = map(int, input().strip().split(' '))
arr = list(map(int, input().strip().split(' ')))
list1 = []
for i in range(n - 1):
	a = arr[i] - arr[i + 1] - c
	list1.append(a)
if max(list1) > 0:
	print(max(list1))
else:
	print('0')


(days, kilos) = map(int, input().split())
prices = list(map(int, input().split()))
profit = 0
for i in range(days - 1):
	profit = max(profit, prices[i] - prices[i + 1] - kilos)
print(profit)


(n, c) = list(map(int, input().split()))
x = list(map(int, input().split()))
sub = 0
for i in range(len(x) - 1):
	a = x[i] - x[i + 1]
	if sub < a:
		sub = a
if sub - c < 0:
	print(0)
else:
	print(sub - c)


(n, c) = map(int, input().split())
arr = [int(x) for x in input().split()]
mx = 0
for i in range(n - 1):
	val = arr[i] - arr[i + 1] - c
	if val > 0:
		mx = max(mx, val)
print(mx)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
for i in range(1, n):
	s = max(s, a[i - 1] - a[i])
if s <= 0 or s - x <= 0:
	print(0)
else:
	print(s - x)


(a, b) = map(int, input().split(' '))
l = []
p = []
l = list(map(int, input().split(' ')))
for i in range(0, a - 1):
	m = l[i] - l[i + 1]
	p.append(m)
n = max(p)
n = n - b
if n > 0:
	print(n)
else:
	print(0)


(n, c) = map(int, input().split())
l = list(map(int, input().split()))
m = 100000
temp = []
for i in range(n - 1):
	temp.append(l[i] - l[i + 1])
m = max(temp)
if m <= 0 or m < c:
	print(0)
else:
	idx = temp.index(m)
	profit = l[idx] - l[idx + 1] - c
	print(profit)


data = input().split()
(N, C) = (int(data[0]), int(data[1]))
barels_prices = input().split()
barels_prices = list(map(int, barels_prices))
max_price = []
for i in range(N - 1):
	max_price.append(barels_prices[i] - barels_prices[i + 1] - C)
if max(max_price) == abs(max(max_price)):
	print(max(max_price))
else:
	print('0')


(n, k) = map(int, input().split())
l1 = list(map(int, input().split()))
max1 = 0
for i in range(len(l1) - 1):
	m1 = l1[i] - l1[i + 1]
	if max1 < m1:
		max1 = m1
if max1 >= k:
	print(max1 - k)
else:
	print(0)


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
a = 0
for i in range(1, n):
	if l[i] - l[i - 1] < 0:
		x = l[i - 1] - l[i] - m
		if x > a:
			a = x
print(a)


(n, c) = map(int, input().split())
barrel = list(map(int, input().split()))
i = 0
profit = 0
while i < len(barrel) - 1:
	if barrel[i] - barrel[i + 1] - c > profit:
		profit = barrel[i] - barrel[i + 1] - c
	i = i + 1
print(profit)


s = input()
a = s.split(' ')
n = int(a[0])
c = int(a[1])
s = input()
a = s.split(' ')
mx = 0
for i in range(n):
	a[i] = int(a[i])
for i in range(0, n - 1):
	if a[i] - a[i + 1] - c > mx:
		mx = a[i] - a[i + 1] - c
print(mx)


st = input().split()
n = int(st[0])
c = int(st[1])
x = input().split()
ans = 0
for i in range(n - 1):
	ans = max(ans, int(x[i]) - int(x[i + 1]) - c)
print(ans)


a = int(input().split()[1])
b = list(map(int, input().split()))
b = [b[0]] + b
c = max(map(lambda x: b[x] - b[x + 1], range(len(b) - 1)))
print(max(c - a, 0))


R = lambda : map(int, input().split())
(n, r) = R()
p = ans = 0
for i in R():
	ans = max(ans, p - i - r)
	p = i
print(ans)


(n, c) = list(map(lambda x: int(x), input().split()))
lstx = list(map(lambda x: int(x), input().split()))
profit = 0
for nitem in range(len(lstx) - 1):
	if lstx[nitem] - lstx[nitem + 1] - c > profit:
		profit = lstx[nitem] - lstx[nitem + 1] - c
print(profit)


string = input()
numbers = string.split(' ')
a = int(numbers[0])
b = int(numbers[1])
string = input()
numbers = string.split(' ')
for x in range(a):
	numbers[x] = int(numbers[x])
raspberries = []
for x in range(a - 1):
	y = numbers[x]
	z = numbers[x + 1]
	value = y - z - b
	if value >= 0:
		raspberries.append(value)
if len(raspberries) == 0:
	maximum = 0
else:
	maximum = max(raspberries)
print(maximum)


line = input()
line = line.split()
n = int(line[0])
c = int(line[1])
line = input()
line = line.split()
xtra = 0
line[0] = int(line[0])
for i in range(1, n):
	line[i] = int(line[i])
	if line[i - 1] - line[i] - c > xtra:
		xtra = line[i - 1] - line[i] - c
print(xtra)


(n, c) = map(int, input().split())
x = input().split()
res = c
for i in range(n - 1):
	res = max(res, int(x[i]) - int(x[i + 1]))
print(max(0, res - c))


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
for i in range(n - 1):
	if l[i] - l[i + 1] > ans:
		ans = l[i] - l[i + 1]
if ans - m > 0:
	print(ans - m)
else:
	print(0)


(n, c) = map(int, input().split())
arr = list(map(int, input().split()))
ans = float('-inf')
for i in range(1, n):
	ans = max(ans, arr[i - 1] - arr[i])
if ans - c < 0:
	print(0)
else:
	print(ans - c)


(n, m) = map(int, input().split())
s = list(map(int, input().split()))
maxi = 0
for i in range(n - 1):
	if s[i] - s[i + 1] > maxi:
		maxi = s[i] - s[i + 1]
print(max(0, maxi - m))


I = lambda : list(map(int, input().split()))
(n, c) = I()
a = I()
print(max([a[i] - a[i + 1] - c for i in range(n - 1)] + [0]))


(n, c) = map(int, input().split())
a = input().split()
res = c
for i in range(n - 1):
	res = max(res, int(a[i]) - int(a[i + 1]))
ass = max(0, res - c)
print(ass)


(n, c) = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
k = max((A[i] - A[i + 1] for i in range(n - 1)))
print(max(0, k - c))


(a, b) = map(int, input().split())
lista = list(map(int, input().split()))
soma = 0
for c in range(a - 1):
	if lista[c] - lista[c + 1] - b > soma:
		soma = lista[c] - lista[c + 1] - b
print(soma)


data = [int(x) for x in input().split()]
days = [int(x) for x in input().split()]
profit = 0
answer = []
for i in range(data[0] - 1):
	profit = days[i] - days[i + 1]
	answer.append(profit)
	profit = 0
if max(answer) - data[1] <= 0:
	print(0)
else:
	print(max(answer) - data[1])


(n_val, c_val) = list(map(int, input().split()))
trade = list(map(int, input().split()))
profit = list()
for day in range(1, n_val):
	profit.append(trade[day] - trade[day - 1])
profit_max = min(profit)
if profit_max >= -c_val:
	profit_max = 0
else:
	profit_max = abs(profit_max) - c_val
print(profit_max)


from sys import stdin
(n, c) = map(int, stdin.readline().split())
arr = list(map(int, stdin.readline().split()))
max_m = 0
for i in range(1, n):
	val = arr[i - 1] - arr[i] - c
	max_m = max(max_m, val)
print(max_m)


(n, m) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
lst = []
for i in range(n - 1):
	lst.append(a[i] - a[i + 1])
ans = max(max(lst) - m, 0)
print(ans)


dia_preco = list(map(int, input().split()))
cot_dia = list(map(int, input().split()))
mlhr_neg = 0
dia_atual = 0
for cot in range(len(cot_dia)):
	if cot + 1 >= len(cot_dia):
		break
	else:
		dia_atual = cot_dia[cot] - cot_dia[cot + 1]
		if dia_atual > mlhr_neg:
			mlhr_neg = dia_atual
print(mlhr_neg - dia_preco[1] if mlhr_neg - dia_preco[1] >= 0 else 0)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(n, c) = LI()
	a = LI()
	r = 0
	for i in range(n - 1):
		t = a[i] - a[i + 1] - c
		if r < t:
			r = t
	return r
print(main())


(n, c) = map(int, input().split())
lis = list(map(int, input().split()))
ans = 0
for i in range(n - 1):
	temp = lis[i] - lis[i + 1] - c
	ans = max(temp, ans)
print(ans)


(n, c) = map(int, input().split(' '))
x = list(map(int, input().split(' ')))
curr = []
for i in range(1, len(x)):
	if x[i - 1] - x[i] == abs(x[i - 1] - x[i]):
		curr.append(x[i - 1] - x[i])
	else:
		curr.append(0)
if max(curr) > 0:
	if max(curr) - c > 0:
		print(max(curr) - c)
	else:
		print(0)
else:
	print(0)


import sys
(n, c) = map(int, sys.stdin.readline().split())
xn = list(map(int, sys.stdin.readline().split()))
ans = 0
for i in range(1, n):
	if xn[i - 1] - xn[i] > ans:
		ans = xn[i - 1] - xn[i]
ans = ans - c
if ans < 0:
	ans = 0
print(ans)


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(n, c) = get_ints()
Arr = get_array()
maxi = -1
for i in range(n - 1):
	if Arr[i] - Arr[i + 1] > maxi:
		maxi = Arr[i] - Arr[i + 1]
if maxi <= c:
	print(0)
else:
	print(maxi - c)


(a, b) = map(int, input().split(' '))
honey = list(map(int, input().split(' ')))
dhoney = [honey[x - 1] - honey[x] for x in range(1, len(honey))]
print(max(max(dhoney) - b, 0))


def solve(c, l):
	res = 0
	l = list(l)
	for i in range(len(l) - 1):
		res = max(res, l[i] - l[i + 1] - c)
	return res
(n, c) = map(int, input().split())
l = map(int, input().split())
print(solve(c, l))


(n, c) = map(int, input().split())
l = list(map(int, input().split()))
diff = []
for i in range(0, n):
	if i < n - 1:
		diff.append(l[i] - l[i + 1])
ind = diff.index(max(diff))
ans = l[ind] - l[ind + 1] - c
if ans > 0:
	print(ans)
else:
	print(0)


(n, c) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [0] * (n - 1)
for i in range(n - 1):
	b[i] = a[i] - a[i + 1]
ans = max(b) - c
print(max(0, ans))


(x, y) = [int(x) for x in input('').split()]
ar = list(map(int, input('').split()))
diff = []
for i in range(len(ar) - 1):
	di = ar[i] - ar[i + 1]
	diff.append(di)
d = diff.index(max(diff))
j = ar[d] - ar[d + 1] - y
if j > 0:
	print(j)
else:
	print(0)