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: interview

Starter code:

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


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)


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


n, c = list(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 = list(map(int,input().split()))
a = list(map(int,input().split()))
maxi = 0
d = -1
for i in range(n-1):
	if maxi < a[i]-a[i+1]:
		maxi = a[i]-a[i+1]
		d = i
if d == -1:
	print(0)
else:
	print(max(a[d]-a[d+1]-c,0))


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


n,c=list(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)


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

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

x = input()
days, cost = [int(i) for i in x.split()]

prices = input()
prices = [int(i) for i in prices.split()]

largest = 0
for i in range(0, days-1):
    #find largest difference, and index in prices
    diff = prices[i] - prices[i+1] - cost
    if diff > largest:
        largest = diff
        indexLargest = i

if largest > 0:
    print(largest)
else:
    print('0')


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

s = input()
l = s.split(" ")
c = int(l[1])
n = int(l[0])

s = input()
l = s.split(" ")


b = []
for i in l:
    b.append(int(i))

m = 0
for i in range(len(b)-1):
    if b[i] - b[i+1] - c > m:
        m = b[i] - b[i+1] - c

print(m)

#fn(pi) = pi-(pi+1)-c
#determine fn(pi) when it is max.

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)




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))


import sys, math, heapq, random, collections, bisect

def main():
    # sys.stdin = open('input.txt', 'r')
    # sys.stdout = open('output.txt', 'w')

    n = list(map(int, input().split()))
    lst = list(map(int, input().split()))
    c_lst = lst[:]
    c_lst.sort()

    if c_lst == lst:
        print(0)

    else:
        c_lst.reverse()
        mx = 0
        rp = 0

        for i in c_lst:
            if rp == i:
                if lst[idx_+1:].index(i) < len(lst[idx_+1:])-1:
                    idx = lst[idx_+1:].index(i)
    
                    if lst[idx_+1:][idx]-lst[idx_+1:][idx+1] > mx:
                        mx = lst[idx_+1:][idx]-lst[idx_+1:][idx+1]
                        
                idx_ = idx+idx_+1

            elif lst.index(i) < len(lst)-1:
                idx = lst.index(i)
                idx_ = idx
                rp = i

                if lst[idx]-lst[idx+1] > mx:
                    mx = lst[idx]-lst[idx+1]

            elif i < mx:
                break

        if (mx-n[1]) > 0:
            print(mx-n[1])
            
        else:
            print(0)

    # sys.stdin.close()
    # sys.stdout.close()

def __starting_point():
    main()

__starting_point()

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

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 = list(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)


#!/usr/bin/env python3

def main():
    readData = lambda : list(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)

def __starting_point():
    main()

__starting_point()

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


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)
else:
	if mayordif<borrow:
		print(0)
	else:
		print(mayordif-borrow)


n, k = map(int, input().split())
t = list(map(int, input().split()))
p = max([t[i - 1] - t[i] for i in range(1, n)])
print(0 if p < k else p - k)

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



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)