inf = open('fence.in', 'r')
ouf = open('fence.out', 'w')

n, f = map(int, inf.readline().split())
a = list(map(int, inf.readline().split()))
a.sort()

l = 0
r = min(f + 1, min(a) + 1)
while (l < r - 1):
	m = (l + r) // 2

	t = 0
	good = True
	for x in a:
		if t + m > f:
			good = False
		t = max(t + m, x)
	if good:
		l = m
	else:
		r = m

print(l, file=ouf)
