Monocarp is playing yet another computer game. In this game, his character has to kill a dragon. The battle with the dragon lasts $100^{500}$ seconds, during which Monocarp attacks the dragon with a poisoned dagger. The $i$-th attack is performed at the beginning of the $a_i$-th second from the battle start. The dagger itself does not deal damage, but it applies a poison effect on the dragon, which deals $1$ damage during each of the next $k$ seconds (starting with the same second when the dragon was stabbed by the dagger). However, if the dragon has already been poisoned, then the dagger updates the poison effect (i.e. cancels the current poison effect and applies a new one).

For example, suppose $k = 4$, and Monocarp stabs the dragon during the seconds $2$, $4$ and $10$. Then the poison effect is applied at the start of the $2$-nd second and deals $1$ damage during the $2$-nd and $3$-rd seconds; then, at the beginning of the $4$-th second, the poison effect is reapplied, so it deals exactly $1$ damage during the seconds $4$, $5$, $6$ and $7$; then, during the $10$-th second, the poison effect is applied again, and it deals $1$ damage during the seconds $10$, $11$, $12$ and $13$. In total, the dragon receives $10$ damage.

Monocarp knows that the dragon has $h$ hit points, and if he deals at least $h$ damage to the dragon during the battle — he slays the dragon. Monocarp has not decided on the strength of the poison he will use during the battle, so he wants to find the minimum possible value of $k$ (the number of seconds the poison effect lasts) that is enough to deal at least $h$ damage to the dragon.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 1000$) — the number of test cases.

The first line of the test case contains two integers $n$ and $h$ ($1 \le n \le 100; 1 \le h \le 10^{18}$) — the number of Monocarp's attacks and the amount of damage that needs to be dealt.

The second line contains $n$ integers $a_1$, $a_2$, ..., $a_n$ ($1 \le a_i \le 10^9; a_i < a_{i + 1}$), where $a_i$ is the second when the $i$-th attack is performed.


-----Output-----

For each test case, print a single integer — the minimum value of the parameter $k$, such that Monocarp will cause at least $h$ damage to the dragon.


-----Examples-----

Input
4
2 5
1 5
3 10
2 4 10
5 3
1 2 4 5 7
4 1000
3 25 64 1337
Output
3
4
1
470


-----Note-----

In the first example, for $k=3$, damage is dealt in seconds $[1, 2, 3, 5, 6, 7]$.

In the second example, for $k=4$, damage is dealt in seconds $[2, 3, 4, 5, 6, 7, 10, 11, 12, 13]$.

In the third example, for $k=1$, damage is dealt in seconds $[1, 2, 4, 5, 7]$.

Difficulty: EASY

Solutions:
from __future__ import division, print_function
import math
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def inp():
	return int(input())

def inps():
	return input().strip()

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

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

def good(k):
	val = k
	for i in range(1, n):
		val += min(k, l[i] - l[i - 1])
	if val >= h:
		return 1
	return 0
for _ in range(inp()):
	(n, h) = invr()
	l = inlt()
	mn = 1
	mx = 10 ** 20
	while mn < mx - 1:
		mid = (mn + mx) // 2
		if good(mid):
			mx = mid
		else:
			mn = mid
	if good(mn):
		print(mn)
	else:
		print(mx)


t = int(input())
while t:
	t -= 1
	(n, h) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	s = 0
	for x in sorted((y - x for (x, y) in zip(a, a[1:]))):
		if s + x * n > h:
			break
		s += x
		n -= 1
	print(0 - (s - h) // n)


import math
t = int(input())
for k in range(t):
	inp = input().split()
	n = int(inp[0])
	h = int(inp[1])
	arr = []
	inp = input().split()
	for i in inp:
		arr.append(int(i))
	arr1 = []
	for i in range(len(arr) - 1):
		arr1.append(arr[i + 1] - arr[i])
	arr1.sort()
	k = 0
	for i in range(len(arr) - 1):
		if arr1[i] * (n - i) >= h:
			if h % (n - i) == 0:
				k = h // (n - i)
			else:
				k = h // (n - i) + 1
			break
		else:
			h -= arr1[i]
	print(k if k != 0 else h)


from math import e

def solve():
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	if n > h:
		print('1')
	else:
		start = 1
		end = h
		mid = 0
		List = {}
		for i in range(n - 1):
			List[i] = arr[i + 1] - arr[i]
		while start <= end:
			mid = (start + end) // 2
			summ = mid
			for i in range(n - 1):
				if mid > List.get(i):
					summ += List.get(i)
				else:
					summ += mid
			if summ < h:
				start = mid + 1
			else:
				end = mid - 1
		print(end + 1)
cases = int(input())
for i in range(cases):
	solve()


def attack(attacks, h):
	(start, end) = (1, h)
	while start <= end:
		mid = (start + end) // 2
		(last, total) = (None, 0)
		for attack in attacks:
			if last:
				total += min(mid, attack - last)
			last = attack
		if last:
			total += mid
		if total >= h:
			end = mid - 1
		else:
			start = mid + 1
	return start
(inp, results) = (int(input()), [])
for _ in range(inp):
	(inp1, inp2) = list(map(int, input().split()))
	inputs = list(map(int, input().split()))
	results.append(attack(inputs, inp2))
print(*results, sep='\n')


from bisect import bisect_left as bl, bisect_right as br
from heapq import heapify, heappop, heappush
from collections import Counter as co
from fractions import Fraction as fr
from math import gcd, log, ceil
mod = 1000000007
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	l = list(map(int, input().split()))
	s = 0
	(ma, mi) = (0, l[-1])
	for i in range(1, n):
		s += l[i] - l[i - 1]
		ma = max(ma, l[i] - l[i - 1])
		mi = min(mi, l[i] - l[i - 1])
		l[i - 1] = l[i] - l[i - 1]
	if mi * n >= h:
		print(ceil(h / n))
	elif ma + s <= h:
		print(h - s)
	else:
		l = l[:-1]
		l.sort()
		pre = l[:]
		pre = [0] + pre
		for i in range(1, n - 1):
			pre[i + 1] += pre[i]

		def f(k):
			i = bl(l, k)
			if pre[i] + (n - i) * k >= h:
				return True
			return False
		(beg, end) = (mi, ma)
		while beg <= end:
			m = beg + end >> 1
			if f(m):
				end = m - 1
			else:
				beg = m + 1
		print(beg)


import sys
from collections import deque
import math
from bisect import bisect_left
from functools import cmp_to_key

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

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

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

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

def FACT(n, mod):
	s = 1
	facts = [1]
	for i in range(1, n + 1):
		s *= i
		s %= mod
		facts.append(s)
	return facts[n]

def C(n, k, mod):
	return FACT(n, mod) * pow(FACT(k, mod) * FACT(n - k, mod) % mod, mod - 2, mod) % mod

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
t = int(input())

def f(m, a, n):
	ans = m
	for j in range(1, n):
		ans += min(a[j] - a[j - 1], m)
	return ans
for _ in range(t):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	low = 1
	high = 10 ** 18
	used_m = -1
	while True:
		m = (low + high) // 2
		if used_m == m:
			break
		if f(m, a, n) > h:
			high = m
		elif f(m, a, n) < h:
			low = m
		else:
			low = m
			break
		used_m = m
	for j in range(-3, 4):
		if f(j + m, a, n) >= h:
			print(j + m)
			break


import os
import sys
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heapify, heappop, heappush, nlargest, nsmallest
from io import BytesIO, IOBase
from types import GeneratorType
BUFSIZE: int = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc

def modInverse(a, m):
	g = gcd(a, m)
	if g != 1:
		return -1
	else:
		return power(a, m - 2, m)

def power(x, y, m):
	if y == 0:
		return 1
	p = power(x, y // 2, m) % m
	p = p * p % m
	if y % 2 == 0:
		return p
	else:
		return x * p % m

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	ans = set()
	for p in range(2, n + 1):
		if prime[p]:
			ans.add(p)
	return ans
MOD = 1000000007

def main():
	t = int(input())
	for i in range(t):
		temp = list(map(int, input().split()))
		(n, h) = (temp[0], temp[1])
		a = list(map(int, input().split()))
		if n == 1:
			print(h)
			continue
		diff = []
		for j in range(1, n):
			diff.append(a[j] - a[j - 1])
		ans = 100000000000000000000
		diff.sort()
		ssum = diff[0]
		found = False
		if n * ssum >= h:
			if h % n == 0:
				ans = min(ans, int(h / n))
			else:
				ans = min(ans, 1 + int(h / n))
			found = True
		if found == False:
			for j in range(1, len(diff)):
				h2 = h - ssum
				if (n - j) * diff[j] >= h2:
					if h2 % (n - j) == 0:
						ans = min(ans, int(h2 / (n - j)))
					else:
						ans = min(ans, int(h2 / (n - j)) + 1)
					found = True
					break
				else:
					ssum += diff[j]
		if found == False:
			h2 = h - ssum
			ans = min(ans, h2)
		print(ans)
main()


def f(l, x, n):
	tt = 0
	for i in range(1, n):
		if l[i - 1] + x >= l[i]:
			tt += l[i] - l[i - 1]
		else:
			tt += x
	tt += x
	return tt >= h
for i in range(int(input())):
	(n, h) = map(int, input().split())
	l = list(map(int, input().split()))
	a = 0
	b = 10 ** 18
	while a + 1 < b:
		mid = b - (b - a) // 2
		if f(l, mid, n):
			b = mid
		else:
			a = mid
	print(b)


t = int(input())
for case in range(t):
	(n, h) = map(int, input().split())
	l = [int(i) for i in input().split()]

	def works(x):
		tot = 0
		for i in range(n - 1):
			if l[i] + x - 1 < l[i + 1]:
				tot += x
			else:
				tot += l[i + 1] - l[i]
		tot += x
		return tot >= h
	low = 0
	high = 1000000000000000000
	rec = 0
	while low <= high:
		rec += 1
		if rec > 100:
			break
		mid = (low + high) // 2
		if works(mid):
			high = mid
		else:
			low = mid + 1
	print(mid)


def ret():
	(n, h) = [int(x) for x in input().split()]
	lst = [int(x) for x in input().split()]
	dicto = {}
	for i in range(1, n):
		dicto[lst[i] - lst[i - 1]] = 0
	for i in range(1, n):
		dicto[lst[i] - lst[i - 1]] += 1
	num = 0
	dicto[10 ** 18 + 100] = 1
	keys = dicto.keys()
	keys = sorted(keys)
	for key in keys:
		if key * (n - num) >= h:
			if h % (n - num) == 0:
				print(h // (n - num))
				return
			print(h // (n - num) + 1)
			return
		else:
			h -= key * dicto[key]
			num += dicto[key]
	print(dicto)
t = int(input())
for _ in range(t):
	ret()


from collections import Counter
from math import ceil, floor, log
import bisect as bs
import sys
input = sys.stdin.readline
inp_lis = lambda : list(map(int, input().split()))
inp_multi = lambda : map(int, input().split())
inp_int = lambda : int(input().strip())
for _ in range(int(input().strip())):
	(n, h) = inp_multi()
	a = inp_lis()
	k = 0
	if n == 1:
		print(h)
		continue
	if h <= n:
		print(1)
		continue
	l = [a[i + 1] - a[i] for i in range(n - 1)]
	l.sort()
	k = 0
	for i in range(n - 1):
		if l[i] * (n - i) >= h:
			k = ceil(h / (n - i))
			break
		else:
			h -= l[i]
	print(k if k != 0 else h)


def solve(n, h, attacks):
	gaps = [attacks[i] - attacks[i - 1] for i in range(1, n)]
	gaps.sort()
	mn = h // n + (1 if h % n else 0)
	rem = h
	spared = 0
	for (i, gap) in enumerate(gaps):
		if gap >= mn:
			if mn * (n - i) < rem:
				mn = min(gap, rem // (n - i) + (1 if rem % (n - i) else 0))
				rem -= mn
			else:
				rem = 0
				break
		else:
			rem -= gap
	if rem - mn > 0:
		mn += rem - mn
	return mn
ans = []
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	ans.append(solve(n, h, list(map(int, input().split()))))
print(*ans, sep='\n')


def totalDamage(diff, k):
	return k + sum([min(d, k) for d in diff])
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = [int(x) for x in input().split()]
	diff = [a[i] - a[i - 1] for i in range(1, n)]
	(start, end) = (1, h)
	while start <= end:
		mid = (start + end) // 2
		damage = totalDamage(diff, mid)
		if damage < h:
			start = mid + 1
		else:
			end = mid - 1
	print(start)


def op():
	(n, h) = map(int, input().split())
	a = [int(i) for i in input().split()]
	a.sort()
	ans = h // n - 1
	run = True
	m = n
	H = h
	while run:
		m = n
		ans += 1
		b = [a[n - 1]]
		for i in range(n - 2, -1, -1):
			if a[i] + ans >= a[i + 1]:
				h -= a[i + 1] - a[i]
				m -= 1
			else:
				b.append(a[i])
		ans = max(ans, h // m - 1)
		if h - m * ans <= 0:
			run = False
		h = H
	print(ans)
for i in range(int(input())):
	op()


tests = int(input())

def checkKill(k, h, gapSeconds):
	soma = 0
	for gap in gapSeconds:
		soma += min(gap, k)
	soma += k
	return soma >= h

def binSearch(h, hits):
	low = 1
	high = h
	k = h
	gapSeconds = [hits[i + 1] - hits[i] for i in range(len(hits) - 1)]
	while low <= high:
		mid = (low + high) // 2
		if checkKill(mid, h, gapSeconds):
			high = mid - 1
			k = mid
		else:
			low = mid + 1
	return k
for test in range(tests):
	(n, h) = list(map(int, input().split()))
	hits = list(map(int, input().split()))
	print(binSearch(h, hits))


from math import ceil
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(a) == 1:
		print(h)
		continue
	x = int(ceil(h / n))
	b = [a[i] - a[i - 1] for i in range(1, n)]
	if min(b) >= x:
		print(x)
		continue
	b.sort()
	ans = 0
	while len(b) > 0:
		x = int(ceil(h / (len(b) + 1)))
		c = min(b)
		if x <= c:
			print(ans + x)
			break
		else:
			h -= (len(b) + 1) * c
			ans += c
			b = [i - c for i in b if i - c != 0]
	else:
		print(ans + h)


t = int(input())
for i in range(t):
	[n, h] = [int(k) for k in input().split(' ')]
	a = [int(k) for k in input().split(' ')]
	b = [0 for k in range(n - 1)]
	for k in range(1, n):
		b[k - 1] += a[k] - a[k - 1]
	b.sort()
	c = h
	d = 0
	for j in range(n - 1):
		if c == b[j] * (n - j):
			print(b[j])
			d = 1
			break
		elif c // (n - j) < b[j]:
			print(c // (n - j) + (c % (n - j) != 0))
			d = 1
			break
		c -= b[j]
	if d == 0:
		print(c)


def check(d):
	(t, ans) = (-int(1e+20), 0)
	for x in v:
		if x - t >= d:
			ans += d
		else:
			ans += x - t
		t = x
	return ans >= k
for ssdhafj in range(int(input())):
	(n, k) = map(int, input().split())
	v = [int(x) for x in input().split()]
	(l, r) = (0, int(1e+20))
	while l < r:
		mid = (l + r) // 2
		if check(mid):
			r = mid
		else:
			l = mid + 1
	print(l)


def solve():
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	if n == 1:
		print(h)
		return
	b = list()
	for i in range(1, n):
		b.append(a[i] - a[i - 1])
	b.sort()
	cnt = n
	for i in range(len(b)):
		check = h // cnt
		if h % cnt != 0:
			check += 1
		if b[i] >= check:
			print(check)
			return
		else:
			h -= b[i]
			cnt -= 1
	print(h)
for _ in range(int(input())):
	solve()


import math
t = int(input())
while t > 0:
	(n, h) = input().split()
	n = int(n)
	h = int(h)
	a = input().split()
	attacks = [int(a[i]) - int(a[i - 1]) for i in range(1, n)]
	attacks.sort()
	dano = math.ceil(h / n)
	i = 0
	while i < n - 1 and attacks[i] <= dano:
		h -= attacks[i]
		i += 1
	while i < n - 1:
		if dano * (n - i) >= h:
			h = 0
			break
		elif attacks[i] * (n - i) < h:
			dano = attacks[i]
			while i < n - 1 and attacks[i] == dano:
				h -= dano
				i += 1
		else:
			dano = math.ceil(h / (n - i))
			h = 0
			break
	if dano < h:
		print(h)
	else:
		print(dano)
	t -= 1


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

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

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

def lsi():
	return list(msi())

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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
mod = 1000000007

def modInverse(b, m):
	g = gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def ceil2(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def modu(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		return -999999999
	else:
		return inv * a % m
from math import log, factorial, cos, tan, sin, radians, floor, sqrt, ceil, log2
import bisect
import random
import string
from itertools import permutations
from decimal import *
getcontext().prec = 50
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def check(a, x, h):
	c = 0
	for i in range(1, len(a)):
		c += min(x, a[i] - a[i - 1])
	c += x
	if c >= h:
		return True
	return False

def main():
	for _ in range(ii()):
		(n, h) = mi()
		a = li()
		lo = 0
		hi = int(1e+18)
		while lo < hi:
			mid = (lo + hi) // 2
			if not check(a, mid, h):
				lo = mid + 1
			else:
				hi = mid
		print(hi)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import atexit
import io
import sys
import math
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def ans_diff(arr, x, n):
	ans = x
	for i in range(n - 1):
		ans += min(x, arr[i + 1] - arr[i])
	return ans
for test in range(int(input())):
	(n, h) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	(l, r) = (0, 10 ** 18)
	while l <= r:
		mid = (l + r) // 2
		curr = ans_diff(arr, mid, n)
		if curr < h:
			l = mid + 1
		else:
			r = mid - 1
	print(r + 1)


from __future__ import print_function
from math import log
from collections import deque
import os
import sys
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
mod = 10 ** 9 + 7

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

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

def ceil(a, b):
	if a % b == 0:
		return a // b
	else:
		return a // b + 1
for _ in range(inp()):
	(n, h) = invr()
	l = inlt()
	d = []
	l.append(10 ** 20)
	for i in range(n):
		d.append(l[i + 1] - l[i])
	d.sort()
	cur = 0
	ans = 0
	k = 0
	for i in range(n):
		rem = n - i
		d[i] -= k
		if rem * d[i] >= h:
			ans += ceil(h, rem)
			print(ans)
			break
		else:
			h = h - d[i] * rem
			ans += d[i]
			k = k + d[i]


n = int(input().split()[0])
for _ in range(n):
	(l, h) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	k = h // l + (1 if h % l else 0)
	df = []
	for i in range(len(arr) - 1):
		df.append(arr[i + 1] - arr[i])
	df.sort()

	def fun(df, k, h):
		for d in range(len(df)):
			if df[d] >= k:
				if k * (l - d) < h:
					k = min(df[d], h // (l - d) + (1 if h % (l - d) else 0))
					h -= k
				else:
					h = 0
					break
			else:
				h -= df[d]
		if h - k > 0:
			k += h - k
		return k
	print(fun(df, k, h))


import sys
input = sys.stdin.readline

def iinput():
	return int(input())

def sinput():
	return input().rstrip()

def i0input():
	return int(input()) - 1

def linput():
	return list(input().split())

def liinput():
	return list(map(int, input().split()))

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

def li0input():
	return list(map(lambda x: int(x) - 1, input().split()))

def mi0input():
	return map(lambda x: int(x) - 1, input().split())
INF = 10 ** 20
MOD = 1000000007
t = iinput()
for _ in [0] * t:
	(n, h) = liinput()
	A = liinput()
	ok = h
	ng = 0
	while ng + 1 < ok:
		check = (ok + ng) // 2
		tmp = 0
		for i in range(n - 1):
			tmp += min(check, A[i + 1] - A[i])
		tmp += check
		if tmp >= h:
			ok = check
		else:
			ng = check
	print(ok)


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = [*map(int, input().split())]

	def s(k):
		s = k
		for i in range(n - 1):
			s += min(k, a[i + 1] - a[i])
		return s
	d = 0
	f = h
	while f > d:
		m = (f + d) // 2
		if s(m) >= h:
			f = m
		else:
			d = m + 1
	print(d)


t = int(input())
while t:
	t -= 1
	(n, h) = map(int, input().split())
	a = [int(x) for x in input().split()]
	dif = sorted((a2 - a1 for (a1, a2) in zip(a, a[1:])))
	isum = 0
	for k in dif:
		if k > (h - isum) // n:
			break
		isum += k
		n -= 1
	print(0 - (isum - h) // n)


def solve(diff, k):
	ans = k
	for i in range(len(diff)):
		ans += min(diff[i], k)
	return ans
for _ in range(int(input())):
	(n, h) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	diff = []
	for i in range(len(a) - 1):
		diff.append(a[i + 1] - a[i])
	ans = 0
	u = 0
	d = 10 ** 18
	while u <= d:
		mid = (u + d) // 2
		temp = solve(diff, mid)
		if temp >= h:
			d = mid - 1
		elif temp < h:
			u = mid + 1
		else:
			ans = mid
			break
	print(u)


import sys
from math import sqrt, gcd
from collections import deque
sys.setrecursionlimit(10 ** 8)
I = lambda : int(input())
S = lambda : input().strip()
M = lambda : map(int, input().strip().split())
L = lambda : list(map(int, input().strip().split()))
mod = 1000000007

def valid(m):
	ans = 0
	for i in range(n - 1):
		ans += min(m, arr[i])
		if ans >= h:
			return True
	ans += m
	if ans >= h:
		return True
	return False
for i in range(I()):
	(n, h) = M()
	li = L()
	arr = []
	for i in range(n - 1):
		arr.append(li[i + 1] - li[i])
	(l, r) = (1, h)
	ans = r
	while l <= r:
		m = (l + r) // 2
		if valid(m):
			ans = min(ans, m)
			r = m - 1
		else:
			l = m + 1
	print(ans)


def check(ans):
	damage = 0
	for i in range(n):
		damage += ans
		if i > 0 and a[i] - a[i - 1] < ans:
			damage -= ans - (a[i] - a[i - 1])
	return damage >= h
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 0
	r = h
	while r - l > 1:
		m = (r + l) // 2
		if check(m):
			r = m
		else:
			l = m
	print(r)


from math import *
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	m = [0 for i in range(n)]
	p = 0
	s = 0
	for i in range(n - 1):
		m[i] = a[i + 1] - a[i]
		p = max(m[i], p)
		s += m[i]
	m[n - 1] = float('inf')
	if h - s >= p:
		print(h - s)
	else:
		q = 1
		ans = p
		while q <= p:
			t = (q + p) // 2
			s = 0
			for i in range(n):
				s += min(t, m[i])
			if s >= h:
				ans = min(t, ans)
				p = t - 1
			else:
				q = t + 1
		print(ans)


def pos(a, x, n):
	sum = 0
	for i in range(len(a)):
		if i != len(a) - 1:
			sum += min(a[i + 1] - a[i], x)
		else:
			sum += x
	return sum >= n
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	lo = 0
	hi = 10 ** 18
	while lo < hi:
		mid = (lo + hi) // 2
		if pos(a, mid, m):
			hi = mid
		else:
			lo = mid + 1
	print(lo)


import sys
input = sys.stdin.readline

def check(x, v):
	cnt = 0
	prev = 0
	for i in range(len(l)):
		if i == 0:
			prev = l[i]
		elif l[i] - prev >= x:
			cnt += x
		else:
			cnt += l[i] - prev
		prev = l[i]
	cnt += x
	if cnt >= v:
		return 1
	return 0
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	l = list(map(int, input().split()))
	low = 0
	high = 10 ** 18
	ans = 0
	while low <= high:
		mid = low + (high - low) // 2
		if check(mid, h):
			ans = mid
			high = mid - 1
		else:
			low = mid + 1
	sys.stdout.write(str(ans) + '\n')


from ctypes import c_longlong as ll

def can_beat(value_k: int, numbers: list, hp: int) -> bool:
	damage = value_k
	for i in range(0, len(numbers) - 1):
		damage += min(numbers[i] + value_k, numbers[i + 1]) - numbers[i]
	if damage >= hp:
		return True
	return False

def solve_test():
	(n, hp) = list(map(int, input().split(' ')))
	numbers = list(map(int, input().split(' ')))
	left = 0
	right = int(1e+18)
	while left <= right:
		middle = (left + right) // 2
		if can_beat(middle, numbers, hp):
			right = middle - 1
		else:
			left = middle + 1
	answer = right + 1
	return answer

def solve():
	tests = int(input())
	for _ in range(tests):
		print(solve_test())
solve()


import sys
t = int(sys.stdin.readline())
for x in range(t):
	(n, h) = map(int, sys.stdin.readline().split())
	a = [int(x) for x in sys.stdin.readline().split()]
	diff = [a[i] - a[i - 1] for i in range(1, n)]
	l = 0
	r = h
	while r - l > 1:
		mid = (l + r) // 2
		damage = mid + sum([min(d, mid) for d in diff])
		if damage >= h:
			r = mid
		else:
			l = mid
	print(r)


def real_input_generator():
	while True:
		yield input()

def example_input_generator(example):
	for line in example.split('\n'):
		yield line
examples = ['4\n2 5\n1 5\n3 10\n2 4 10\n5 3\n1 2 4 5 7\n4 1000\n3 25 64 1337']

def solve(test_case_num=-1):
	if test_case_num < 0:
		ig = real_input_generator()
	else:
		print('TESTING NOW')
		ig = example_input_generator(examples[test_case_num])
	t = int(next(ig))
	for _ in range(t):
		[n, h] = list(map(int, next(ig).split()))
		lst = list(map(int, next(ig).split()))
		print(solution(n, h, lst))

def solution(n, h, lst):
	if n >= h:
		return 1
		_hy_anon_var_2 = None
	else:
		_hy_anon_var_2 = None
	for i in range(n - 1):
		lst[i] = lst[i + 1] - lst[i]
	lst[n - 1] = h
	lst.sort()
	for [i, v] in enumerate(lst):
		if v * (n - i) >= h:
			return (h - 1) // (n - i) + 1
			_hy_anon_var_3 = None
		else:
			_hy_anon_var_3 = None
		h -= v
	return lst[-1] + h
solve()


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.append(10 ** 19)
	(left, right) = (0, 10 ** 18)
	while right - left > 1:
		m = (right + left) // 2
		ans = 0
		for i in range(n):
			ans += min(a[i + 1] - a[i], m)
		if ans < h:
			left = m
		else:
			right = m
	print(right)


def add(a, k, n):
	ans = 0
	for i in range(n - 1):
		ans += k if a[i + 1] - a[i] >= k else a[i + 1] - a[i]
	return ans + k

def binary(n, h, a):
	l = 1
	r = h
	while l < r:
		mid = (l + r) // 2
		curr = add(a, mid, n)
		if curr == h:
			return mid
		elif curr < h:
			l = mid + 1
		else:
			r = mid
	return r
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	print(binary(n, h, a))


from sys import stdin, stdout
input = stdin.readline

def ceil(a, b):
	return (a + b - 1) // b

def f():
	for i in range(n - 1):
		val = pre[i] + diff[i] * (i + 1)
		if h >= val:
			return diff[i] + ceil(h - val, i + 1)
	return ceil(h, n)
t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	a = [int(x) for x in input().split()]
	if n == 1:
		print(h)
		continue
	diff = []
	for i in range(n - 1):
		diff.append(a[i + 1] - a[i])
	diff = sorted(diff)
	pre = [diff[0]]
	for i in range(1, n - 1):
		pre.append(pre[-1] + diff[i])
	diff = diff[::-1]
	pre = pre[::-1]
	print(f())


import math

def dagger(n, h, L):
	if n == 1:
		return h
	dmg = int(h / n)
	if h % n != 0:
		dmg += 1
	remain = []
	for i in range(n):
		if L[i] > dmg:
			remain.append(L[i] - dmg)
			h -= dmg
		else:
			h -= L[i]
	if h <= 0:
		return dmg
	return dmg + dagger(len(remain), h, remain)
cases = int(input())
for j in range(cases):
	line = input().split()
	n = int(line[0])
	h = int(line[1])
	get = input().split()
	L = []
	for i in range(n - 1):
		L.append(int(get[i + 1]) - int(get[i]))
	L.sort()
	L.append(math.inf)
	print(dagger(n, h, L))


import sys
import math
from fractions import Fraction
from decimal import *
input = sys.stdin.readline
t = int(input())
while t > 0:
	inp = input().strip()
	arr = [int(x) for x in inp.split(' ')]
	n = arr[0]
	h = arr[1]
	inp = input().strip()
	arr = [int(x) for x in inp.split(' ')]
	maxd = []
	i = 1
	while i < len(arr):
		maxd.append(arr[i] - arr[i - 1])
		i += 1
	maxd.append(10 ** 50)
	maxd.sort()
	ans = 0
	d_left = h
	curi = 0
	while d_left > 0:
		minreq = math.ceil(Decimal(d_left) / Decimal(len(maxd) - curi))
		if minreq <= maxd[curi]:
			ans = minreq
			break
		else:
			i = curi
			while maxd[i] == maxd[curi]:
				d_left -= maxd[i]
				i += 1
			curi = i
	print(ans)
	t -= 1


from sys import stdin
import math
from collections import deque
from heapq import heapify, heappop, heappush
from bisect import bisect_left, bisect_right
input = stdin.readline

def ceil(m, n):
	val = m // n
	if m % n != 0:
		return val + 1
	return val
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	arr = sorted(list(map(int, input().split())))
	(diff, heap) = (-1, [])
	heapify(heap)
	for i in range(1, n):
		heappush(heap, arr[i] - arr[i - 1])
	(present, val) = (n, ceil(h, n))
	(done, prev) = (False, 0)
	while present > 1 and heap:
		val = heappop(heap) - prev
		if val * present >= h:
			print(prev + ceil(h, present))
			done = True
			break
		h -= val * present
		prev = val + prev
		present -= 1
	if done:
		continue
	print(h + prev)


numeroTestes = int(input())
results = []
for a in range(numeroTestes):
	status = [int(t) for t in input().split()]
	numeroAtaques = status[0]
	vida = status[1]
	hits = [int(t) for t in input().split()]
	intervalos = []
	for hit in range(len(hits) - 1):
		intervalos.append(hits[hit + 1] - hits[hit])
	intervalos = sorted(intervalos)
	dano = 0
	for intervalo in intervalos:
		if dano + intervalo * numeroAtaques > vida:
			break
		dano += intervalo
		numeroAtaques -= 1
	results.append(0 - (dano - vida) // numeroAtaques)
for r in results:
	print(r)


import os
import sys
from io import BytesIO, IOBase
from collections import Counter, defaultdict
import math
import heapq
import bisect
import collections
import copy

def ceil(a, b):
	return (a + b - 1) // b
BUFSIZE = 8192
inf = float('inf')

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
get = lambda : sys.stdin.readline().rstrip('\r\n')
MOD = 1000000007

def v():
	return list()

def solve(l, x, n):
	sum = 0
	for i in range(len(l)):
		if i != len(l) - 1:
			sum += min(mid, l1[i + 1] - l1[i])
		else:
			sum += mid
	return sum >= h
for _ in range(int(get())):
	(n, h) = map(int, get().split())
	l1 = list(map(int, get().split()))
	l = [i + 1 for i in range(n)]
	start = 0
	end = 10 ** 18
	while start < end:
		mid = (start + end) // 2
		if solve(l1, mid, h):
			end = mid
		else:
			start = mid + 1
	print(start)


R = lambda : map(int, input().split())
(t,) = R()
while t:
	t -= 1
	(n, h) = R()
	a = (*R(),)
	i = len(a)
	s = 0
	for x in sorted((y - x for (x, y) in zip(a, a[1:]))):
		if s + x * i > h:
			break
		s += x
		i -= 1
	print(0 - (s - h) // i)


from sys import stdin, stdout, setrecursionlimit
from io import BytesIO, IOBase
setrecursionlimit(10000)

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None
		self.BUFSIZE = 8192

	def read(self):
		while True:
			a = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			if not a:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(a), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			a = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			self.newlines = a.count(b'\n') + (not a)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(a), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))
input = lambda : stdin.readline().rstrip('\r\n')
inp = lambda : int(input())
st = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
int_arr = lambda : list(map(int, input().strip().split()))
str_arr = lambda : list(map(str, input().split()))
get_str = lambda : map(str, input().strip().split())
get_int = lambda : map(int, input().strip().split())
get_float = lambda : map(float, input().strip().split())
mod = 1000000007
for _ in range(inp()):
	(n, h) = get_int()
	a = int_arr()
	l = 1
	r = h
	att = 0
	ans = 0
	while l <= r:
		att = 0
		m = (l + r) // 2
		for i in range(n - 1):
			if a[i + 1] - a[i] > m:
				att += m
			else:
				att += a[i + 1] - a[i]
		att += m
		if att >= h:
			r = m - 1
			ans = m
		else:
			l = m + 1
	print(ans)


t = int(input())
for caseNr in range(1, t + 1):
	(n, h) = list(map(int, input().split()))
	arr = list(map(int, input().split()))

	def apply_attack(mid, h):
		total = 0
		cur_end = -1
		for (i, a) in enumerate(arr):
			if a + mid - 1 <= cur_end:
				continue
			else:
				total += min(a + mid - cur_end - 1, mid)
				cur_end = a + mid - 1
		return total >= h
	left = 0
	right = 10 ** 18
	while left < right:
		mid = (left + right) // 2
		if apply_attack(mid, h):
			right = mid
		else:
			left = mid + 1
	print(left)


T = int(input())
for i in range(0, T):
	(n, h) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	l = 0
	r = 9223372036854775807
	while l < r:
		m = (l + r) // 2
		t = h
		for i in range(1, n):
			if m < a[i] - a[i - 1]:
				t -= m
			else:
				t -= a[i] - a[i - 1]
		t -= m
		if t <= 0:
			r = m
		else:
			l = m + 1
	print(l)


import math
t = int(input())

def solution(n, l, h, arr, life):
	global ans
	if l > h:
		return
	sum = 0
	expected_answer = l + (h - l) // 2
	for i in range(n - 1):
		x = arr[i + 1] - arr[i]
		if x <= expected_answer:
			sum += x
		else:
			sum += expected_answer
	sum = sum + expected_answer
	if sum >= life:
		ans = expected_answer
		solution(n, l, expected_answer - 1, arr, life)
	else:
		solution(n, expected_answer + 1, h, arr, life)
for i in range(t):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	if n == 1:
		print(h)
		continue
	l = math.ceil(h / n)
	life = h
	solution(n, l, h, arr, life)
	print(ans)


import sys
t = int(sys.stdin.readline())
for i in range(t):
	(n, h) = tuple(map(int, sys.stdin.readline().strip().split()))
	arr = list(map(int, sys.stdin.readline().strip().split()))
	if n == 1:
		print(h)
		continue
	arr.sort()
	arr_diff = [0] * (len(arr) - 1)
	for j in range(len(arr) - 1):
		arr_diff[j] = arr[j + 1] - arr[j]
	arr_diff.sort()
	(result, cur) = (0, arr_diff[0])
	if h <= cur * len(arr):
		result = h // len(arr) + (1 if h % len(arr) > 0 else 0)
	else:
		h -= cur * len(arr)
		result = cur
		for j in range(len(arr) - 1):
			if arr_diff[j] == cur:
				continue
			diff = (arr_diff[j] - cur) * (len(arr) - j)
			if h <= diff:
				result += h // (len(arr) - j) + (1 if h % (len(arr) - j) > 0 else 0)
				h = 0
				break
			else:
				result = arr_diff[j]
				cur = arr_diff[j]
				h -= diff
		result += h
	print(result)


def check(k):
	s = 0
	for (x, y) in zip(a, a[1:]):
		if y - x <= k:
			s += y - x
		else:
			s += k
	s += k
	return s >= h
for i in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	(lo, hi) = (0, 10 ** 18 + 1)
	while hi - lo > 1:
		mid = (hi + lo) // 2
		if check(mid):
			hi = mid
		else:
			lo = mid
	print(hi)


from __future__ import division, print_function
import math
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def I():
	return int(input())

def lint():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
import itertools
from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)
import sys

def S():
	return list(map(str, input().strip()))

def grid(r, c):
	return [lint() for i in range(r)]
from collections import defaultdict, Counter, deque
import math
import heapq
from heapq import heappop, heappush
import bisect
from math import factorial, inf
from itertools import groupby
from itertools import permutations as comb
mod = 1000000007
MOD = 998244353

def gcd(a, b):
	while b:
		a %= b
		tmp = a
		a = b
		b = tmp
	return a

def lcm(a, b):
	return a // gcd(a, b) * b

def check_prime(n):
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def primefactors(n):
	num = 0
	while n % 2 == 0:
		num += 1
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			num += 1
			n = n // i
	if n > 2:
		num += 1
	return num

def ask(a, b, c):
	print(c, a, b, flush=True)
	n = I()
	return n

def linear_sieve(n):
	is_composite = [False] * n
	prime = []
	for i in range(2, n):
		if not is_composite[i]:
			prime.append(i)
		for j in prime:
			is_composite[i * j] = True
			if i % prime == 0:
				break
	return prime

def dfs(i, p, d):
	(a, tmp) = (0, 0)
	for j in d[i]:
		if j != p:
			a += 1
			tmp += dfs(j, i)
	if a == 0:
		return 0
	return tmp / a + 1

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n // i
	if n > 2:
		l.append(n)
	return l

def binpow(a, b, c):
	res = 1
	a = a % c
	while b > 0:
		if b & 1:
			res = res * a % c
		b = b >> 1
		a = a * a % c
	return res
d = []
primes = []
prim = [0] * (10 ** 6 + 1)

def sieve(n):
	for i in range(n):
		d.append(i)
	for i in range(2, n):
		if d[i] == i:
			prim[i] = 1
			primes.append(i)
		j = 0
		while j < len(primes) and primes[j] <= d[i] and (primes[j] * i < n):
			d[i * primes[j]] = primes[j]
			j += 1

def primeFactors(n):
	factors = []
	while n != 1:
		factors.append(d[n])
		n //= d[n]
	return factors
t = 1
t = I()
for _ in range(t):
	(n, h) = lint()
	a = lint()
	(l, r) = (1, h)
	res = h
	while l <= r:
		m = (l + r) // 2
		i = 0
		d = 0
		for i in range(1, n):
			d += min(a[i] - a[i - 1], m)
		d += m
		if d >= h:
			res = m
			r = m - 1
		else:
			l = m + 1
	print(res)


test_case_count = int(input())
for i in range(test_case_count):
	(attack_count, target_damage) = input().split(' ')
	(attack_count, target_damage) = (int(attack_count), int(target_damage))
	attacks = [int(value) for value in input().split()]
	intervals = []
	for i in range(len(attacks) - 1):
		delta = attacks[i + 1] - attacks[i]
		intervals.append(delta)
	intervals.sort()
	acc_damage = 0
	for interval in intervals:
		if acc_damage + interval * attack_count > target_damage:
			break
		acc_damage += interval
		attack_count -= 1
	result = (acc_damage - target_damage) // attack_count
	print(-result)


def fun(m, n, q):
	for jj in range(n):
		if q <= 0:
			return True
		if 1 + jj < n:
			xx = min(a[jj + 1] - a[jj], m)
			q -= xx
		else:
			q -= m
	if q > 0:
		return False
	else:
		return True
for ii in range(int(input())):
	(n, q) = map(int, input().split())
	a = list(map(int, input().split()))
	(l, r, x) = (0, q, 0)
	while l <= r:
		mid = l - (l - r) // 2
		if not fun(mid, n, q):
			l = mid + 1
		else:
			x = mid
			r = mid - 1
	print(x)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def damage(a, k):
	return sum((min(a[i] - a[i - 1], k) for i in range(1, len(a)))) + k

def solve(h, a):
	low = 1
	high = 10 ** 18
	while low < high:
		mid = (low + high) // 2
		if damage(a, mid) >= h:
			high = mid
		else:
			low = mid + 1
	for i in range(max(0, mid - 10), mid + 10):
		if damage(a, i) >= h:
			return i
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = [*map(int, input().split())]
	print(solve(h, a))


import sys

def f(l, n, f):
	a = 0
	x = n - 1
	while a <= x:
		m = a + (x - a) // 2
		if l[m] == f:
			return m
		elif l[m] > f:
			x = m - 1
		else:
			a = m + 1
	return None
for _ in range(int(sys.stdin.readline())):
	(n, h) = map(int, sys.stdin.readline().split())
	l = list(map(int, sys.stdin.readline().split()))
	if n == 1:
		print(h)
	else:
		a = []
		for i in range(n - 1):
			a.append(l[i + 1] - l[i])
		a.sort()
		if h % n == 0:
			k = h // n
		else:
			k = h // n + 1
		if a[0] >= k:
			print(k)
		else:
			for i in range(1, n - 1):
				h = h - a[i - 1]
				n = n - 1
				if h % n == 0:
					k = h // n
				else:
					k = h // n + 1
				if a[i] >= k:
					print(k)
					break
			else:
				print(max(h - a[-1], k))


def damage_amount(diffs, partial_sum, k):
	l = 0
	r = len(partial_sum) - 1
	while l < r:
		c = (l + r) // 2
		if diffs[c] > k:
			r = c
		else:
			l = c + 1
	return partial_sum[l - 1] + k * (len(partial_sum) - l)
t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	diffs = list(sorted([a[i + 1] - a[i] for i in range(n - 1)] + [h]))
	partial_sum = []
	s = 0
	for v in diffs:
		s += v
		partial_sum.append(s)
	min_k = (h - 1) // n + 1
	max_k = h + 1 - n
	k = None
	damage = 0
	while min_k < max_k:
		k = (max_k + min_k) // max(2, damage // h)
		damage = damage_amount(diffs, partial_sum, k)
		if damage >= h:
			max_k = k
		else:
			min_k = k + 1
	print(min_k)


from math import *
from bisect import bisect_left as bl
from bisect import bisect_right as br
from collections import Counter as ctr
from collections import deque as dq
from array import array
from re import search
li = lambda : list(map(int, input().split()))
arr = lambda a: array('i', a)
bi = lambda n: bin(n).replace('0b', '')
yn = lambda f: print('NYOE S'[f::2])
sbstr = lambda a, s: search('.*'.join(a), s)

def solve():
	for _ in range(int(input())):
		(n, h) = li()
		a = li()
		b = [a[i + 1] - a[i] for i in range(n - 1)]
		b.sort()
		k = 0
		for i in range(n - 1):
			if b[i] * (n - i) >= h:
				k = ceil(h / (n - i))
				break
			else:
				h -= b[i]
		print(k if k != 0 else h)
solve()


import sys
input = lambda : sys.stdin.buffer.readline().rstrip()
mi = lambda : map(int, input().split())
li = lambda : list(mi())
INF = float('inf')
for _ in range(int(input())):
	(n, h) = mi()
	a = li() + [INF]
	(ng, ok) = (0, h)
	while ok - ng > 1:
		mid = ok + ng >> 1
		s = 0
		for i in range(n):
			if a[i + 1] - a[i] > mid:
				s += mid
			else:
				s += a[i + 1] - a[i]
		if s >= h:
			ok = mid
		else:
			ng = mid
	print(ok)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(i) for i in st()]
n = h = l = 0

def doit(k):
	global n, h, l
	l = sorted(l)
	ans = 0
	for i in range(1, n):
		ans += min(k, l[i] - l[i - 1])
	ans += k
	return ans >= h
for _ in range(val()):
	(n, h) = li()
	l = li()
	low = 1
	ans = high = 10 ** 50
	while low <= high:
		mid = low + high >> 1
		if doit(mid):
			ans = mid
			high = mid - 1
		else:
			low = mid + 1
	print(ans)


import math
for pratyush in range(int(input())):
	d = []
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	for k in range(n - 1):
		d.append(a[1 + k] - a[k])
	d.sort()
	(ans, c) = (0, n)
	for k in range(n - 1):
		if d[k] * c < h:
			h -= d[k]
			c -= 1
		else:
			ans = int(math.ceil(h / c))
			h = 0
			break
	if h != 0:
		ans = h
	print(ans)


import sys
input = sys.stdin.readline

def check(ans):
	damage = 0
	for i in range(n - 1):
		damage += min(arr[i + 1] - arr[i], ans)
	damage += ans
	return damage >= h
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	(low, high) = (1, 10 ** 18)
	while low <= high:
		mid = (low + high) // 2
		if check(mid):
			high = mid - 1
		else:
			low = mid + 1
	print(low)


t = int(input())

def score(n, a, k):
	ans = k
	for i in range(n - 1):
		ans += min(a[i + 1] - a[i], k)
	return ans
for _ in range(t):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	flag = False
	left = 0
	right = 10 ** 18 + 1
	while left + 1 < right:
		mid = (left + right) // 2
		if score(n, a, mid) > h:
			right = mid
		elif score(n, a, mid) < h:
			left = mid
		else:
			flag = True
			break
	if flag:
		print((left + right) // 2)
	else:
		print(right)


import math
for i in range(0, int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	dist = list()
	for j in range(0, len(a) - 1):
		dist.append(a[j + 1] - a[j])
	dist.sort()
	if len(dist) == 0:
		dist.append(a[0])
	else:
		dist.append(dist[len(dist) - 1])
	sum = 0
	pred_sum = 0
	flag = 0
	k = 0
	for j in range(0, len(a)):
		sum = pred_sum + (len(a) - j) * dist[j]
		if sum >= h:
			flag = 1
			k = j
			break
		pred_sum += dist[j]
	if flag == 0:
		if len(dist) == 1:
			print(h)
		else:
			print(h - pred_sum + dist[len(dist) - 1])
	else:
		sum = 0
		sum = (h - pred_sum) // (len(a) - k)
		if (h - pred_sum) % (len(a) - k):
			sum += 1
		print(sum)


t = int(input())

def count(k, delay):
	result = k
	for time in delay:
		result += min(k, time)
	return result
for _ in range(t):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	gap = []
	for i in range(1, n):
		gap.append(arr[i] - arr[i - 1])
	left = 1
	right = h
	while left < right:
		k = (left + right) // 2
		curr = count(k, gap)
		if curr == h:
			left = k
			break
		elif curr < h:
			left = k + 1
		else:
			right = k
	print(left)


def check(arr, k, tar):
	n = len(arr)
	start = arr[0]
	ans = 0
	for i in range(1, n):
		if arr[i] - start >= k:
			ans += k
		else:
			ans += arr[i] - start
		start = arr[i]
	ans += k
	if ans >= tar:
		return True
	return False
T = int(input())
for case in range(T):
	(N, h) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 1
	r = h
	while l < r:
		mid = (l + r) // 2
		if check(a, mid, h):
			r = mid
		else:
			l = mid + 1
	print(l)


import sys, os, io
import math, cmath, time, collections
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
start_time = time.time()
primes = []
mod = 10 ** 9 + 7

def power(x, b):
	p = 1
	while b > 0:
		if b & 1:
			p = p * x
			p = p % mod
		b = b >> 1
		x = x ** x
		x = x % mod
	return p % mod

def seive(n):
	a = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p ** 2, n + 1, p):
				prime[i] = False
		p = p + 1
	for p in range(2, n + 1):
		if prime[p]:
			primes.append(p)

def yn(x):
	if x:
		sys.stdout.write('Yes' + '\n')
	else:
		sys.stdout.write('No' + '\n')

def win(att, h, k) -> bool:
	hc = 0
	for i in range(1, len(att)):
		hc += min(k, att[i] - att[i - 1])
	hc += k
	return hc >= h

def solve():
	(n, h) = map(int, input().split())
	att = list(map(int, input().split()))
	(s, e) = (1, 10 ** 50)
	ans = 0
	while s <= e:
		mid = (s + e) // 2
		if win(att, h, mid):
			e = mid - 1
			ans = mid
		else:
			s = mid + 1
	sys.stdout.write(str(ans) + '\n')

def main():
	tc = 1
	tc = int(input())
	for testcases in range(1, tc + 1):
		solve()
	sys.stdout.close()
main()


import os
import sys
from math import *
from bisect import *
from io import BytesIO, IOBase
from typing import overload

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = int(1000000000.0 + 7)
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]

def ok(k):
	ans = 0
	for i in range(len(a) - 1):
		ans += min(k, a[i + 1] - a[i])
	return ans >= h
for _ in range(Int()):
	(n, h) = value()
	a = array()
	a.append(inf)
	ans = -1
	l = 1
	r = h
	while l <= r:
		m = l + (r - l) // 2
		if ok(m):
			ans = m
			r = m - 1
		else:
			l = m + 1
	print(ans)


t = int(input())
for aboba in range(t):
	(n, h) = map(int, input().split())
	s = list(map(int, input().split()))
	for i in range(n - 1):
		s[i] = s[i + 1] - s[i]
	s[-1] = 10000000000000000000
	k = 10 ** 18
	left = 0
	right = k
	while left + 1 < right:
		k = (left + right) // 2
		c = 0
		for el in s:
			c += min(el, k)
		if c > h:
			right = k
		else:
			left = k
	c = 0
	for el in s:
		c += min(el, left)
	if c < h:
		print(right)
	else:
		print(left)


import math
inf = math.inf
qu = []
for _ in range(int(input())):
	(x, h) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	(l, r) = (0, 10 ** 18 + 5)
	best = inf
	ans = inf

	def is_valid(k):
		damage = 0
		for i in range(0, len(arr) - 1):
			damage += min(k, arr[i + 1] - arr[i])
		damage += k
		if damage >= h:
			return True
		else:
			return False
	while l <= r:
		mid = l + (r - l) // 2
		if is_valid(mid):
			ans = min(ans, mid)
			r = mid - 1
		else:
			l = mid + 1
	print(ans)


sr = lambda : input()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
inf = 10 ** 18
mod = 998244353
test = ir()
for t in range(test):
	(n, h) = lr()
	a = lr()

	def judge(k):
		pre = a[0]
		dame = k
		for num in a[1:]:
			dame += min(k, num - pre)
			pre = num
		if h <= dame:
			return True
		else:
			return False
	l = 0
	r = 10 ** 18
	mid = (l + r) // 2 + 1
	while r - l > 1:
		mid = l + (r - l) // 2
		if judge(mid):
			r = mid
		else:
			l = mid
	print(r)


for _ in range(int(input())):
	(n, h) = [*map(int, input().split())]
	a = [*map(int, input().split())]
	k = 0

	def somme(k):
		s = k
		for i in range(0, n - 1):
			s += min(a[i + 1] - a[i], k)
		return s

	def binary(x, y):
		if x == y:
			return x
		elif somme((x + y) // 2) < h:
			return binary((x + y) // 2 + 1, y)
		else:
			return binary(x, (x + y) // 2)
	print(binary(k, h))


def solution(a, b, nums):
	s = []
	n = len(nums)
	for i in range(1, n):
		s.append(nums[i] - nums[i - 1])
	s.append(int(1e+18))

	def helper(s, k, b):
		res = 0
		for diff in s:
			res += min(diff, k)
		return res >= b
	(left, right) = (1, int(1e+18))
	while left < right:
		curr = (left + right) // 2
		if helper(s, curr, b):
			right = curr
		else:
			left = curr + 1
	return left
t = int(input())
for _ in range(t):
	a_b = input().split()
	a = int(a_b[0])
	b = int(a_b[1])
	nums = [int(x) for x in input().split()]
	print(solution(a, b, nums))


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	k = list(map(int, input().split()))
	kd = [0]
	for i in range(1, len(k)):
		kd.append(k[i] - k[i - 1])
	kd.sort()
	fin = False
	fix = 0
	x = 0
	for (i, t) in enumerate(kd[1:]):
		xt = fix + kd[i + 1] * (n - i)
		if xt < m:
			fix += kd[i + 1]
			x = kd[i + 1]
		elif xt == m:
			print(kd[i + 1])
			fin = True
			break
		else:
			(l, r) = (kd[i], t)
			md = (l + r) // 2
			rx = 0
			while r - l > 1:
				md = (l + r) // 2
				f = fix + md * (n - i)
				if f == m:
					rx = md
					break
				elif f < m:
					l = md
				else:
					r = md
			if rx == 0:
				rx = r
			fin = True
			print(rx)
			break
	if len(kd) == 1:
		fin = True
		print(m)
	if fin == False:
		print(m - fix)


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	l1 = [int(i) for i in input().split()]
	l2 = []
	for i in range(1, n):
		l2 += [l1[i] - l1[i - 1]]
	if n == 1:
		print(h)
		continue
	l = -1
	r = h + 1
	m = 0
	sm = sum(l2)
	mn = min(l2)
	mx = max(l2)
	while r - l > 1:
		m = 0
		y = (l + r) // 2
		if y >= mx:
			m = sm + y
		elif y <= mn:
			m = n * y
		else:
			for i in l2:
				m += min(i, y)
			m += y
		if m == h:
			break
		elif m < h:
			l = (l + r) // 2
		else:
			r = (l + r) // 2
	if m < h:
		print(y + 1)
		continue
	print(y)


import sys, os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import math
import bisect
t = int(input())
for a0 in range(t):
	(n, h) = [int(i) for i in input().split()]
	l = [int(i) for i in input().split()]
	le = 1
	r = 10 ** 18
	while le <= r:
		mid = (le + r) // 2
		add = mid
		for i in range(n - 1):
			add += min(mid, l[i + 1] - l[i])
		if add >= h:
			r = mid - 1
		else:
			le = mid + 1
	print(1 + r)


from collections import Counter
from math import ceil
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	l = list(map(int, input().split()))
	c = []
	p = l[0]
	for x in l[1:]:
		c.append(x - p)
		p = x
	c = Counter(c)
	c = [[x, c[x]] for x in c]
	c.sort(key=lambda c: c[0])
	cur = 0
	ans = 0
	for x in c:
		if (x[0] - cur) * n + ans >= h:
			cur += ceil((h - ans) / n)
			ans = h
		else:
			ans += (x[0] - cur) * n
			n -= x[1]
			cur = x[0]
	if ans < h:
		cur += h - ans
	print(cur)


import math

def Poison_damage(dragon_hp, poison_ticks, remaining_attacks):
	if dragon_hp < remaining_attacks:
		return 1
	sum_damage = 0
	for curr_damage in poison_ticks:
		if curr_damage > (dragon_hp - sum_damage) // remaining_attacks:
			break
		sum_damage += curr_damage
		remaining_attacks -= 1
	return 0 - (sum_damage - dragon_hp) // remaining_attacks
amount_of_data = int(input())
dragon_raids = []
for _ in range(amount_of_data):
	(amount_attacks, dragon_hp) = map(int, input().split())
	attacks = tuple(map(int, input().split()))
	poison_ticks = [attacks[curr] - attacks[curr - 1] for curr in range(1, len(attacks))]
	poison_ticks.sort()
	dragon_raids.append(tuple([amount_attacks, dragon_hp, poison_ticks]))
for curr_try in dragon_raids:
	amount_attacks = curr_try[0]
	dragon_hp = curr_try[1]
	poison_ticks = curr_try[2]
	print(Poison_damage(dragon_hp, poison_ticks, amount_attacks))


import sys
import math
from collections import deque, Counter
from sys import stdin
int1 = lambda x: int(x) - 1
stinput = lambda : stdin.readline()[:-1]
ii = lambda : int(stinput())
mi = lambda : map(int, stdin.readline().split())
li = lambda : list(mi())
mi1 = lambda : map(int1, stdin.readline().split())
li1 = lambda : list(mi1())
mis = lambda : map(str, stdin.readline().split())
pr = print
rg = range
from collections import defaultdict
d = defaultdict(int)
mod = 10 ** 9 + 7
Mod = 998244353
INF = 10 ** 18
ans = 0

def is_ok(arg):
	tmp = a[0]
	cnt = 0
	for i in range(n):
		cnt += min(a[i] - tmp, arg)
		tmp = a[i]
	cnt += arg
	if cnt >= h:
		return True
	else:
		return False

def bisect(ng, ok):
	while abs(ok - ng) > 1:
		mid = (ok + ng) // 2
		if is_ok(mid):
			ok = mid
		else:
			ng = mid
	return ok
t = ii()
for _ in range(t):
	(n, h) = mi()
	a = li()
	print(bisect(0, h + 1))


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 1
	r = 10 ** 18
	while l <= r:
		m = (l + r) // 2
		s = m
		for i in range(n - 1):
			s += min(m, a[i + 1] - a[i])
		if s < h:
			l = m + 1
		else:
			r = m - 1
	print(r + 1)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
MOD = 10 ** 9 + 7
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import ceil

def main():
	for _ in range(int(input())):
		(n, h) = map(int, input().split())
		a = [*map(int, input().split())]
		l = 1
		r = 10 ** 18
		while l <= r:
			mid = (l + r) // 2
			s = mid
			for i in range(n - 1):
				s += min(mid, a[i + 1] - a[i])
			if s < h:
				l = mid + 1
			else:
				r = mid - 1
		print(r + 1)
main()


tests = int(input())
for _ in range(tests):
	[n, h] = [int(x) for x in input().split()]
	attacks = [int(x) for x in input().split()]
	dmgs = sorted((a2 - a1 for (a1, a2) in zip(attacks, attacks[1:])))
	s = 0
	for k in dmgs:
		if k > (h - s) // n:
			break
		s += k
		n -= 1
	print(0 - (s - h) // n)


def check(arr, n, h, k):
	for i in range(1, n):
		h -= min(arr[i] - arr[i - 1], k)
	if h <= k:
		return True
	return False
t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	start = 1
	end = h
	while start <= end:
		mid = (start + end) // 2
		if check(arr, n, h, mid):
			end = mid - 1
		else:
			start = mid + 1
	print(start)


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	dif = []
	for i in range(1, n):
		dif.append(a[i] - a[i - 1])
	dif.sort()
	k = h // n
	left = h % n
	ans = k
	for i in range(n - 1):
		if dif[i] < k:
			left += k - dif[i]
			dif[i] = 0
		else:
			dif[i] -= k
			x = left // (n - i)
			if x <= dif[i]:
				dif[i] -= x
				if dif[i] > 0 and left % (n - i) > 0:
					dif[i] -= 1
					left -= x + 1
					ans = max(ans, k + x + 1)
				else:
					left -= x
					ans = max(ans, k + x)
			else:
				left -= dif[i]
				ans = max(ans, k + dif[i])
				dif[i] = 0
	print(max(ans, left + k))


def total_damage(intervals, pre_sum, k):
	(low, high, out) = (0, len(intervals) - 1, 0)
	while low <= high:
		mid = (low + high) // 2
		if intervals[mid] >= k:
			high = mid - 1
		else:
			low = mid + 1
	return pre_sum[low] + (len(pre_sum) - low) * k

def bs(intervals, pre_sum, needed):
	(low, high, out) = (0, needed, 0)
	while low <= high:
		mid = (low + high) // 2
		damage = total_damage(intervals, pre_sum, mid)
		if damage == needed:
			return mid
		elif damage < needed:
			low = mid + 1
			out = mid + 1
		else:
			high = mid - 1
	return out

def solution():
	n = int(input())
	for i in range(0, n):
		info = [int(num) for num in input().split(' ')]
		needed = info[1]
		attacks = [int(num) for num in input().split(' ')]
		intervals = [attacks[i] - attacks[i - 1] for i in range(1, len(attacks))]
		intervals.sort()
		pre_sum = [0]
		for (j, interval) in enumerate(intervals):
			pre_sum.append(pre_sum[j] + interval)
		print(bs(intervals, pre_sum, needed))
solution()


t = int(input())

def is_ok(A, h, k):
	cnt = 0
	for i in range(len(A)):
		if i == len(A) - 1:
			cnt += k
		elif A[i] + k - 1 >= A[i + 1]:
			cnt += A[i + 1] - A[i]
		else:
			cnt += k
	if cnt >= h:
		return True
	else:
		return False

def solve(n, h, A):
	ng = 0
	ok = 10 ** 18
	while ok - ng > 1:
		k = (ng + ok) // 2
		if is_ok(A, h, k):
			ok = k
		else:
			ng = k
	return ok
ans = []
for _ in range(t):
	(n, h) = map(int, input().split())
	A = list(map(int, input().split()))
	ans.append(solve(n, h, A))
for a in ans:
	print(a)


import math
T = int(input())
while T > 0:
	A = [int(i) for i in input().split()]
	B = [int(i) for i in input().split()]
	C = []
	for i in range(A[0] - 1):
		C.append(B[i + 1] - B[i])
	C.sort()
	k = -1
	h = 0
	i = 0
	while i < A[0] - 1:
		k = C[i]
		h += C[i]
		if A[1] <= h + (A[0] - i - 1) * k:
			break
		i += 1
	if A[1] > h + (A[0] - i) * k:
		k = A[1] - h
	else:
		k = math.ceil((A[1] - (h - C[i])) / (A[0] - i))
	print(k)
	T -= 1


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
rep = range
R = range

def I():
	return int(input())

def LI():
	return [int(i) for i in input().split()]

def SLI():
	return sorted([int(i) for i in input().split()])

def LI_():
	return [int(i) - 1 for i in input().split()]

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def NLI(n):
	return [[int(i) for i in input().split()] for i in range(n)]

def NLI_(n):
	return [[int(i) - 1 for i in input().split()] for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RLI(n=8, a=1, b=10):
	return [random.randint(a, b) for i in range(n)]

def RI(a=1, b=10):
	return random.randint(a, b)

def INP():
	N = 1000
	n = random.randint(2, N)
	mn = 0
	mx = 30
	return str(n)

def Rtest(T):
	(case, err) = (0, 0)
	for i in range(T):
		inp = INP()
		a1 = naive(inp)
		a2 = solve(inp)
		if a1 != a2:
			print(inp)
			print('naive', a1)
			print('solve', a2)
			err += 1
		case += 1
	print('Tested', case, 'case with', err, 'errors')

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = a
		bb = b
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def RE(E):
	rt = [[] for i in range(len(E))]
	for i in range(len(E)):
		for (nb, d) in E[i]:
			rt[nb] += ((i, d),)
	return rt

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
alp = [chr(ord('a') + i) for i in range(26)]
show_flg = False
show_flg = True
ans = 0
for _ in range(I()):
	ans = 0
	(n, h) = LI()
	a = LI()

	def c(k):
		d = 0
		for i in range(n):
			if i < n - 1:
				d += min(a[i + 1] - a[i], k)
			else:
				d += k
		return d >= h
	(l, r) = (0, h + 1)
	while r - l > 1:
		m = l + r >> 1
		if c(m):
			r = m
		else:
			l = m
	print(r)


def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

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

def check(mid, diff):
	add = 0
	for i in range(len(diff)):
		if diff[i] < mid:
			add += diff[i]
		else:
			add += mid
	return add + mid

def binarySearch(h, diff):
	(start, end) = (1, h)
	ans = 0
	while start <= end:
		mid = start + (end - start) // 2
		if check(mid, diff) < h:
			start = mid + 1
		else:
			end = mid - 1
			ans = mid
	return ans
t = inp()
for _ in range(t):
	(n, h) = invr()
	time = inlt()
	diff = []
	for i in range(n - 1):
		diff.append(time[i + 1] - time[i])
	print(binarySearch(h, diff))


from bisect import bisect, bisect_left
from sys import stdin, stdout
rd = lambda : list(map(int, stdin.readline().split()))
rds = lambda : stdin.readline().rstrip()
ii = lambda : int(stdin.readline())
INF = 1 << 62
mod = 10 ** 9 + 7

def check(m, ar, h):
	d = 0
	for i in range(len(ar) - 1):
		d += min(m, ar[i + 1] - ar[i])
	d += m
	return d >= h
for _ in range(ii()):
	(n, h) = rd()
	ar = rd()
	(l, r) = (0, h)
	while l < r:
		m = (l + r) // 2
		if check(m, ar, h):
			r = m
		else:
			l = m + 1
	print(l)


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	(l, r) = (0, h)
	while r - l > 1:
		m = (l + r) // 2
		cv = 0
		ct = a[0]
		for x in a:
			cv += min(x - ct, m)
			ct = x
		cv += m
		if cv < h:
			l = m
		else:
			r = m
	print(r)


from collections import defaultdict
import sys

class DisjointSet:
	parent = {}
	cp = {}
	rank = {}
	m = 0

	def makeSet(self, universe):
		for i in universe:
			self.parent[i] = i
			self.cp[i] = 1
			self.rank[i] = 0

	def Find(self, k):
		if self.parent[k] != k:
			self.parent[k] = self.Find(self.parent[k])
		return self.parent[k]

	def Union(self, a, b):
		x = self.Find(a)
		y = self.Find(b)
		if x == y:
			return
		if self.rank[x] > self.rank[y]:
			self.parent[y] = x
			self.cp[x] += self.cp[y]
			self.cp[y] = 0
			self.m = max(self.m, self.cp[x])
		elif self.rank[x] < self.rank[y]:
			self.parent[x] = y
			self.cp[y] += self.cp[x]
			self.cp[x] = 0
			self.m = max(self.m, self.cp[y])
		else:
			self.parent[x] = y
			self.rank[y] = self.rank[y] + 1
			self.cp[y] += self.cp[x]
			self.cp[x] = 0
			self.m = max(self.m, self.cp[y])

def printSets(universe, ds):
	print([ds.Find(i) for i in universe])
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

def MI():
	return map(int, sys.stdin.buffer.readline().split())

def LI():
	return list(map(int, sys.stdin.buffer.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()

def li():
	return [int(i) for i in input().split()]

def lli(rows):
	return [li() for _ in range(rows)]

def si():
	return input()

def ii():
	return int(input())

def ins():
	return input().split()

def drank(d, processing, da, rank):
	tmp = 10 ** 9
	if len(d[da]) == 1:
		return 1
	for di in d[da]:
		if processing[di - 1] == 0:
			processing[di - 1] = 1
			tmp = min(tmp, drank(d, processing, di, rank))
			processing[di - 1] = 0
	rank[da - 1] = tmp + 1
	return tmp + 1

def binary_search(n, a):
	l = len(a)
	low = 0
	high = l - 1
	while high >= low:
		mid = (high + low) // 2
		if a[mid] == n:
			return mid
		elif a[mid] > n:
			high = mid - 1
		else:
			low = mid + 1
	return -1
is_prime = [True] * (10 ** 6 + 1)

def primeseive(n):
	is_prime[0] = is_prime[1] = False
	i = 2
	while i * i <= n:
		if is_prime[i] == True:
			for j in range(i * i, n + 1, i):
				is_prime[j] = False
		i += 1

def satis(a, m):
	i = 0
	l = len(a)
	j = 1
	ans = 0
	while i < l:
		k = 0
		while j < l and a[j] < a[i] + m:
			j += 1
			k += 1
		if k == 0:
			ans += m
			i += 1
			j += 1
		else:
			ans += a[i + k] - a[i]
			i = i + k
			j = i + 1
	return ans

def solve():
	(n, h) = LI()
	a = LI()
	if n == 1:
		return h
	if h <= n:
		return 1
	else:
		low = 1
		high = h
		m = 10 ** 18
		while high >= low:
			mid = (low + high) // 2
			x = satis(a, mid)
			if x > h:
				high = mid - 1
				if x < m:
					m = x
					prev = mid
			elif x < h:
				low = mid + 1
			else:
				return mid
		return prev

def main():
	for _ in range(II()):
		sys.stdout.write(str(solve()) + '\n')
main()


def okie(X, h, k):
	p = len(X)
	cnt = 0
	for i in range(p - 1):
		if X[i] + (k - 1) < X[i + 1]:
			cnt += k
		else:
			cnt += X[i + 1] - X[i]
	cnt += k
	if cnt >= h:
		return True
	else:
		return False
t = int(input())
for i in range(t):
	(n, h) = map(int, input().split())
	X = list(map(int, input().split()))
	lo = 1
	hi = h
	while lo < hi:
		mid = (lo + hi) // 2
		if okie(X, h, mid):
			hi = mid
		else:
			lo = mid + 1
	print(lo)


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	dif = []
	for i in range(n - 1):
		dif.append(a[i + 1] - a[i])

	def check(num):
		tot = 0
		for d in dif:
			tot += min(d, num)
		return tot + num
	ans = h
	l = 1
	r = h
	while l <= r:
		mid = (l + r) // 2
		cur = check(mid)
		if cur >= h:
			ans = mid
			r = mid - 1
		else:
			l = mid + 1
	print(ans)


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	a = sorted(a)
	b = [0] * n
	l = a[0]
	c = 0
	md = 0
	for i in range(n - 1):
		b[i] = a[i + 1] - a[i]
		md = max(md, b[i])
		c += b[i]
	b[n - 1] = float('inf')
	if m - c >= md:
		print(m - c)
	else:
		r = md
		f = r
		l = 1
		while l <= r:
			mid = (l + r) // 2
			c = 0
			for i in range(n):
				c += min(b[i], mid)
			if c >= m:
				f = min(f, mid)
				r = mid - 1
			else:
				l = mid + 1
		print(f)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	(n, h) = invr()
	A = inlt()

	def ok(k):
		dmg = 0
		for (i, a) in enumerate(A):
			if i == n - 1:
				dmg += k
			else:
				dmg += min(k, A[i + 1] - a)
		return dmg >= h
	l = 1
	r = h + 1
	while l < r:
		mid = (l + r) // 2
		if ok(mid):
			r = mid
		else:
			l = mid + 1
	print(l)


t = int(input())

def find(A, key):
	full = 10 ** 18
	low = 1
	high = 0
	while True:
		high = (low + full) // 2
		summ = 0
		for i in key:
			summ += min(i, high)
		summ += high
		if summ <= A:
			low = high
		elif summ > A:
			full = high
		if low + 1 >= full:
			break
	return (full, low)
for i in range(t):
	(n, h) = map(int, input().split())
	B = list(map(int, input().split()))
	Bb = len(B) - 1
	for j in range(Bb):
		B[j] = B[j + 1] - B[j]
	del B[-1]
	(full, low) = find(h, B)
	check = 0
	for e in B:
		check += min(e, low)
	check += low
	if check < h:
		print(full)
	else:
		print(low)


import math

def main_function():
	test_cases = range(int(input()))
	for test_case in test_cases:
		(n, h) = [int(i) for i in input().split(' ')]
		a = [int(i) for i in input().split(' ')] + [10 ** 20]
		b = []
		for i in range(1, len(a)):
			b.append(a[i] - a[i - 1])
		b.sort()
		length = len(b)
		counter = 0
		prev_val = 0
		for i in range(len(b)):
			another_counter = (length - i) * (b[i] - prev_val)
			if counter + another_counter < h:
				counter += another_counter
			elif counter + another_counter == h:
				k = b[i]
				break
			else:
				another_counter = h - counter
				k = prev_val + int(bool(another_counter % (length - i))) + another_counter // (length - i)
				break
			prev_val = b[i]
		print(k)
main_function()


for _ in range(int(input())):
	(n, h) = list(map(int, input().split()))
	values = list(map(int, input().split()))
	(lo, hi) = (1, h)
	while lo <= hi:
		k = (lo + hi) // 2
		life = h
		for x in range(len(values) - 1):
			life -= min(k, values[x + 1] - values[x])
			if life <= 0:
				break
		life -= k
		if life <= 0:
			hi = k - 1
		else:
			lo = k + 1
	print(lo)


twoPowers = []
b = 1
while b <= 1e+18:
	twoPowers.append(b)
	b *= 2
twoPowers.reverse()

def main():
	t = int(input())
	allans = []
	for _ in range(t):
		(n, h) = readIntArr()
		a = readIntArr()

		def check(k):
			damage = k
			for i in range(n - 1):
				damage += min(k, a[i + 1] - a[i])
			return damage >= h
		ans = 0
		for b in twoPowers:
			if check(ans + b) == False:
				ans += b
		ans += 1
		allans.append(ans)
	multiLineArrayPrint(allans)
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([''.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultValFactory, dimensionArr):
	dv = defaultValFactory
	da = dimensionArr
	if len(da) == 1:
		return [dv() for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(i, j):
	print('? {} {}'.format(i, j))
	sys.stdout.flush()
	return int(input())

def answerInteractive(i, j, k):
	print('! {} {} {}'.format(i, j, k))
	sys.stdout.flush()
inf = float('inf')
from math import gcd, floor, ceil
import math
for _abc in range(1):
	main()


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
LOGN = 20
INF = 10 ** 9 + 5
MOD = 10 ** 9 + 7

def solve():

	def check(k):
		res = 0
		for i in range(n - 1):
			res += min(k, A[i + 1] - A[i])
		res += k
		return res >= h
	(n, h) = map(int, input().split())
	A = list(map(int, input().split()))
	(l, r) = (1, h)
	while l <= r:
		mid = l + (r - l) // 2
		if check(mid):
			r = mid - 1
		else:
			l = mid + 1
	print(l)
for _ in range(int(input())):
	solve()


def rsolve(a, k, n):
	s = 0
	for i in range(n - 1):
		s += k if a[i + 1] - a[i] >= k else a[i + 1] - a[i]
	return s + k

def solve():
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 1
	r = h
	while l < r:
		m = (l + r) // 2
		x = rsolve(a, m, n)
		if x == h:
			return m
		elif x < h:
			l = m + 1
		else:
			r = m
	return r
for _ in range(int(input())):
	print(solve())


from collections import *
import sys
import io, os
import math
from heapq import *
gcd = math.gcd
sqrt = math.sqrt

def ceil(a, b):
	a = -a
	k = a // b
	k = -k
	return k
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def strinp(testcases):
	k = 5
	if testcases == -1 or testcases == 1:
		k = 1
	f = str(input())
	f = f[2:len(f) - k]
	return f

def check(arr, d, h):
	c = 0
	for i in range(len(arr) - 1):
		if arr[i] + d >= arr[i + 1]:
			c += arr[i + 1] - arr[i]
		else:
			c += d
	c += d
	if c < h:
		return True
	return False

def binsearch2(arr, h):
	pos = 0
	last = 10 ** 18
	i = last
	while i > 0:
		while check(arr, pos + i, h):
			pos = pos + i
		i = i // 2
	return pos + 1

def main():
	t = int(input())
	for i in range(t):
		arr = list(map(int, input().split()))
		n = arr[0]
		h = arr[1]
		arr = list(map(int, input().split()))
		print(binsearch2(arr, h))
main()


from bisect import bisect
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	a = []
	for i in range(1, n):
		a.append(arr[i] - arr[i - 1])
	a.sort()

	def sol(x):
		i = bisect(a, x)
		y = sum(a[:i])
		y += (n - i) * x
		if y >= h:
			return True
		return False

	def bs(l, h):
		if l == h:
			return l
		if h == l + 1:
			if sol(l):
				return l
			return h
		m = (l + h) // 2
		if sol(m):
			if sol(m - 1) == False:
				return m
			else:
				return bs(l, m - 1)
		else:
			return bs(m + 1, h)
	print(bs(1, h))


t = int(input())
for t1 in range(t):
	(n, h) = (int(i) for i in input().split())
	sts = [int(i) for i in input().split()]
	if n == 1:
		print(h)
		continue
	diffs = [sts[i] - sts[i - 1] for i in range(1, len(sts))]
	diffs.sort()
	s = 0
	l = n
	rem = 0
	h1 = h - s
	rem = h1 // l
	f = 0
	if h1 % l != 0:
		rem += 1
	if rem <= diffs[0]:
		print(rem)
		continue
	for i in range(n - 2):
		s += diffs[i]
		l -= 1
		h1 = h - s
		rem = h1 // l
		if h1 % l != 0:
			rem += 1
		if rem <= diffs[i + 1]:
			print(rem)
			f = 1
			break
	if f == 0:
		s += diffs[-1]
		rem = h - s
		print(rem)


import heapq
import sys
import math
from collections import deque
from bisect import bisect_left, bisect_right
I = sys.stdin.readline
II = lambda : int(I())
IN = lambda x: map(int, x.split())
FN = lambda x: map(float, x.split())
L = lambda x: list(IN(x))
M = 1000000007
P = print
T = True
F = False
for _ in range(II()):
	(n, h) = IN(I())
	a = L(I())
	diff = []
	for i in range(n - 1):
		diff.append(a[i + 1] - a[i])
	diff.sort()
	ans = 0
	for i in range(n - 1):
		if h <= 0:
			break
		if diff[i] == ans:
			continue
		cap = (n - i) * (diff[i] - ans)
		if h <= cap:
			ans += (h + n - i - 1) // (n - i)
		else:
			ans = diff[i]
		h -= cap
	if h > 0:
		print(ans + h)
	else:
		print(ans)


def attack_value(fs, k):
	attack = 0
	for i in range(len(fs) - 1):
		if k + fs[i] <= fs[i + 1]:
			attack = attack + k
		else:
			attack = attack + (fs[i + 1] - fs[i])
	return attack + k

def k_value(n, h, fs):
	final_mid = h + 1
	start = 1
	end = h
	while start <= end:
		mid = (start + end) // 2
		attack = attack_value(fs, mid)
		if attack < h:
			start = mid + 1
		else:
			final_mid = min(final_mid, mid)
			end = mid - 1
	return final_mid
t = int(input())
for i in range(t):
	(n, h) = input().split()
	(n, h) = (int(n), int(h))
	fs = [int(x) for x in input().split()]
	final_mid = k_value(n, h, fs)
	print(final_mid)


mod = 10 ** 9 + 7
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 1
	r = 10 ** 18
	ans = 10 ** 18
	while l <= r:
		m = (l + r) // 2
		d = 0
		for i in range(n - 1):
			d = d + min(m, a[i + 1] - a[i])
			if d >= h:
				break
		d = d + m
		if d >= h:
			ans = m
			r = m - 1
		else:
			l = m + 1
	print(ans)


t = int(input())
for j in range(t):
	s = input().split()
	n = int(s[0])
	h = int(s[1])
	s = input().split()
	a = []
	count = n
	for i in range(1, n):
		a.append(int(s[i]) - int(s[i - 1]))
	a.append(h)
	if h % n == 0:
		k = h // n
	else:
		k = h // n + 1
	a.sort()
	for i in range(n):
		if a[i] >= k:
			print(k)
			break
		else:
			h = h - a[i]
			count -= 1
			if h % count == 0:
				k = h // count
			else:
				k = h // count + 1


import sys
input = sys.stdin.readline
ip = lambda : input().rstrip('\n')
IP = lambda : list(map(int, ip().split()))
IPF = lambda : list(map(float, ip().split()))
import math
for i in range(int(ip())):
	(n, h) = IP()
	a = IP()
	l = 1
	r = 10 ** 18
	while l <= r:
		m = (l + r) // 2
		s = m
		for i in range(n - 1):
			s += min(a[i + 1] - a[i], m)
		if s < h:
			l = m + 1
		else:
			r = m - 1
	print(l)


import decimal
import math
t = int(input())
for i in range(t):
	(n, h) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	diff = []
	for delta in range(n - 1):
		diff.append(a[delta + 1] - a[delta])
	diff.sort()
	k = 0
	l = n - 1
	while l != 0:
		if (l + 1) * diff[0] < h:
			h -= (l + 1) * diff[0]
			k += diff[0]
			l -= 1
			for m in range(1, l + 1):
				diff[m] -= diff[0]
			del diff[0]
		else:
			break
	k += math.ceil(decimal.Decimal(h) / decimal.Decimal(l + 1))
	print(k)


import math

def modInverse(p, q):
	mod = 998244353
	expo = 0
	expo = mod - 2
	while expo:
		if expo & 1:
			p = p * q % mod
		q = q * q % mod
		expo >>= 1
	return p

def answer(x, y, li):
	s = []
	for p in range(0, len(li) - 1):
		s.append(li[p + 1] - li[p])
	s.append(y + 1)

	def solu(s, fi, y):
		m = 0
		for j in range(0, len(s)):
			m = m + min(s[j], fi)
		return m >= y
	low = 1
	high = y + 1
	ans = 0
	while low < high:
		fi = (low + high) // 2
		if solu(s, fi, y):
			high = fi
			ans = fi
		else:
			low = fi + 1
	return ans
t = int(input())
for i in range(0, t):
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	li = input().split()
	for k in range(0, len(li)):
		li[k] = int(li[k])
	print(answer(x, y, li))


from sys import stdin
import math

def main():
	t = int(stdin.readline())
	for i in range(t):
		x = stdin.readline().split()
		n = int(x[0])
		h = int(x[1])
		arr = stdin.readline().split()
		for j in range(n):
			arr[j] = int(arr[j])
		arr.append(int(1e+40))
		if n == 1:
			print(h)
			continue
		l = 0
		r = int(1e+18) + 1
		while r - l > 1:
			dmg = 0
			mid = (r + l) // 2
			for j in range(n):
				tmp = arr[j + 1] - arr[j]
				dmg += min(tmp, mid)
			if dmg < h:
				l = mid
			else:
				r = mid
		print(r)
	return
main()


for _ in ' ' * int(input()):
	(n, h) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [a[i + 1] - a[i] for i in range(n - 1)]

	def test(k):
		return sum((min(k, b[i]) for i in range(n - 1))) + k >= h

	def search(min_, max_):
		while max_ - min_ > 1:
			v = (min_ + max_) // 2
			if test(v):
				max_ = v
			else:
				min_ = v
		return max_
	print(search(0, h))


import os
import sys
from io import BytesIO, IOBase
import threading
from bisect import bisect_right
from math import gcd, log
from collections import Counter
from pprint import pprint
from itertools import permutations
from bisect import bisect_right

def main():
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr.append(10 ** 20)
	l = 0
	r = 10 ** 18
	ans = -1
	while l <= r:
		mid = (l + r) // 2
		dm = 0
		for i in range(n):
			dm += min(arr[i] + mid, arr[i + 1]) - arr[i]
		if dm >= h:
			ans = mid
			r = mid - 1
		else:
			l = mid + 1
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	main()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter, defaultdict
import math

def nck(n, k):
	res = 1
	for i in range(1, k + 1):
		res = res * (n - i + 1) // i
	return res
mod = 10 ** 9 + 7

def can(x):
	ans = x
	for i in range(n - 1):
		ans += min(arr[i + 1] - arr[i], x)
	if ans >= h:
		return True
	return False
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	k = 10 ** 18 + 2
	l = 0
	r = 10 ** 18 + 1
	while l <= r:
		mid = (l + r) // 2
		if can(mid):
			r = mid - 1
			k = mid
		else:
			l = mid + 1
	print(k)


t = int(input())
for _ in range(t):
	(n, h) = [int(x) for x in input().split()]
	a = [int(i) for i in input().split()]
	dmg_dif = [a[i + 1] - a[i] for i in range(n - 1)]
	(start, end) = (1, h)
	while start <= end:
		half = (start + end) // 2
		damage = half + sum([min(d, half) for d in dmg_dif])
		if damage < h:
			start = half + 1
		else:
			end = half - 1
	print(start)


import sys
import pprint
import logging
from logging import getLogger

def input():
	return sys.stdin.readline().rstrip('\r\n')
logging.basicConfig(format='%(message)s', level=logging.WARNING)
logger = getLogger(__name__)
logger.setLevel(logging.INFO)

def debug(msg, *args):
	logger.info(f'{msg}={pprint.pformat(args)}')

def OK(k, A, h):
	a = A[:]
	acc = 0
	ans = len(A) * k
	n = len(A)
	for i in range(n):
		x = a[i] + (k - 1)
		if i + 1 < n and x >= a[i + 1]:
			acc += x - a[i + 1] + 1
		if (i + 1) * k - acc >= h:
			return True
	ans -= acc
	return True if ans >= h else False
for i in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	(lo, hi) = (0, 10 ** 18)
	ans = -1
	while lo <= hi:
		m = lo + hi >> 1
		if OK(m, a, h):
			hi = m - 1
			ans = m
		else:
			lo = m + 1
	print(ans)


from collections import deque as de
import math
import sys
from math import sqrt as sq
from math import floor as fl
from math import ceil as ce
from sys import stdin, stdout
import time
sys.setrecursionlimit(10 ** 7)
from collections import Counter as cnt
from functools import reduce
from itertools import groupby as gb
from bisect import bisect_left as bl, bisect_right as br
from typing import Coroutine

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def __iter__(self):
		return iter(self.data)

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0

	def len(self):
		return len(self.data)
arrStack = My_stack()

class graph:

	def __init__(self):
		self.graphdict = {}

	def add_edge(self, node, neighbor):
		if node not in self.graphdict:
			self.graphdict[node] = [neighbor]
		else:
			self.graphdict[node].append(neighbor)

	def show_edge(self):
		for node in self.graphdict:
			for neighbors in self.graphdict:
				print(node, neighbors)

	def show_graph(self):
		return self.graphdict

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

def binarytodecimal(n):
	return int(n, 2)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def getProduct(n):
	product = 1
	while n != 0:
		product = product * (n % 10)
		n = n // 10
	return product

def regularBracketsequence(str, arrStack):
	for i in range(len(str)):
		if str[i] == '(':
			arrStack.my_push(str[i])
		elif arrStack.isEmpty():
			return False
		else:
			arrStack.my_pop()
	if arrStack.isEmpty():
		return True
	else:
		return False

def lcm(x, y):
	lcm = x * y // math.gcd(x, y)
	return lcm

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def checkisap(list):
	d = list[1] - list[0]
	for i in range(2, len(list)):
		temp = list[i] - list[i - 1]
		if temp != d:
			return False
	return True

def primes_method5(n):
	out = {}
	sieve = [True] * (n + 1)
	for p in range(2, n + 1):
		if sieve[p]:
			out[p] = 1
			for i in range(p, n + 1, p):
				sieve[i] = False
	return out

def id(i, j, col):
	ans = (i - 1) * col
	ans += j
	return ans

def getSum(n):
	strr = str(n)
	list_of_number = list(map(int, strr.strip()))
	return sum(list_of_number)

def checkperfectsquare(n):
	if ce(sq(n)) == fl(sq(n)):
		return True
	else:
		return False

def combinatrics(n, r):
	num = n
	deno = n - r
	pr = 1
	for i in range(num, deno, -1):
		pr *= i
	an = 1
	for i in range(1, r + 1):
		an *= i
	ans = pr // an
	return ans

def ceildiv(x, y):
	return (x + y - 1) // y

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

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def si():
	return list(map(str, input()))

def indict():
	dic = {}
	for (index, value) in enumerate(input().split()):
		dic[int(value)] = int(index)
	return dic

def frqdict():
	dic = {}
	for (index, value) in enumerate(input()):
		if value not in dic:
			dic[value] = 1
		else:
			dic[value] += 1
	return dic
t = ii()
while t:
	t -= 1
	(n, h) = di()
	a = li()
	if n == 1:
		print(h)
	elif n == 2:
		diff = a[1] - a[0]
		if 2 * diff == h:
			print(diff)
		elif 2 * diff > h:
			print(ceildiv(h, 2))
		else:
			print(h - diff)
	else:
		temp = []
		for i in range(1, n):
			temp.append(a[i] - a[i - 1])
		temp.sort()
		s = 0
		for i in range(len(temp)):
			s += temp[i]
			tempsum = s + temp[i] * (n - i - 1)
			if tempsum >= h:
				break
		if tempsum >= h:
			s -= temp[i]
			ans = ceildiv(h - s, n - i)
			print(ans)
		else:
			print(h - s)


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	if n == 1:
		print(h)
		continue
	dif = []
	for i in range(1, n):
		dif.append(arr[i] - arr[i - 1])
	l = 1
	r = h
	while l <= r:
		mid = (l + r) // 2
		s = 0
		for item in dif:
			if item <= mid:
				s += item
			else:
				s += mid
		s += mid
		if s >= h:
			r = mid - 1
		else:
			l = mid + 1
	print(r + 1)


import sys
import os.path
from collections import *
import math
import bisect
import heapq as hq
from fractions import Fraction
from random import randint
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
input = sys.stdin.readline

def solve():
	(n, h) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	arr.append(10 ** 19)
	l = 1
	r = 10 ** 18 + 5
	k = -1
	while l <= r:
		mid = (l + r) // 2
		x = 0
		for i in range(n):
			x += min(mid, arr[i + 1] - arr[i])
		if x >= h:
			r = mid - 1
			k = mid
		else:
			l = mid + 1
	print(k)
t = int(input())
while t:
	t -= 1
	solve()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for t in range(int(input())):
	(n, h) = map(int, input().split())
	l = list(map(int, input().split()))
	a = 1
	b = 10 ** 18
	ans = 10 ** 18
	while a < b:
		mid = (a + b) // 2
		c = mid
		for i in range(n - 1):
			if l[i + 1] - l[i] >= mid:
				c += mid
			else:
				c += l[i + 1] - l[i]
		if c >= h:
			b = mid
			ans = mid
		else:
			a = mid + 1
	print(ans)


import sys
import io, os
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	A = list(map(int, input().split()))

	def is_ok(k):
		cnt = 0
		for i in range(n - 1):
			cnt += min(k, A[i + 1] - A[i])
		cnt += k
		if cnt >= h:
			return True
		else:
			return False
	ng = 0
	ok = h
	while ng + 1 < ok:
		c = (ng + ok) // 2
		if is_ok(c):
			ok = c
		else:
			ng = c
	print(ok)


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a = [x - a[0] for x in a]
	ans = 0
	while h > 0:
		if len(a) >= h:
			ans += 1
			break
		part = h // len(a)
		residue = h % len(a)
		n_a = [0]
		for i in range(len(a) - 1):
			if a[i + 1] - a[i] > part:
				n_a.append(n_a[-1] + a[i + 1] - a[i] - part)
			else:
				residue += part - (a[i + 1] - a[i])
		ans += part
		a = n_a
		h = residue
	print(ans)


import sys, math
INF = float('inf')
mod = 10 ** 9 + 7
input = lambda : sys.stdin.readline().rstrip()
li = lambda : list(map(int, input().split()))
t = int(input())

def check(x, N, H):
	for i in range(N - 1):
		H -= min(A[i + 1] - A[i], x)
	H -= x
	return H <= 0
for _ in range(t):
	(N, H) = li()
	A = li()
	ok = 10 ** 18 + 1
	ng = -1
	while ok - ng > 1:
		mid = (ok + ng) // 2
		if check(mid, N, H):
			ok = mid
		else:
			ng = mid
	print(ok)


num = int(input())
while num:
	num -= 1
	(n, h) = list(map(int, input().split()))
	a = [int(x) for x in input().split()]
	differ = sorted((a2 - a1 for (a1, a2) in zip(a, a[1:])))
	sum = 0
	for k in differ:
		if k > (h - sum) // n:
			break
		sum += k
		n -= 1
	print(0 - (sum - h) // n)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def main(t):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))

	def getcost(k):
		output = 0
		for i in range(n):
			if i + 1 < n:
				output += min(k, arr[i + 1] - arr[i])
			else:
				output += k
		return output
	front = 1
	rear = h
	while front < rear:
		mid = (front + rear) // 2
		if getcost(mid) < h:
			front = mid + 1
		else:
			rear = mid
	print(front)
T = int(input())
t = 1
while t <= T:
	main(t)
	t += 1


for i in range(int(input())):
	(n, h) = map(int, input().split())
	a = [*map(int, input().split())] + [int(1e+40)]
	l = 0
	r = int(1e+18) + 1
	while r - l > 1:
		mid = (r + l) // 2
		k = 0
		for i in range(n):
			k += min(mid, a[i + 1] - a[i])
		if k < h:
			l = mid
		else:
			r = mid
	print(r)


import math as m
i = input()
inp = []
for a in range(0, int(i)):
	inp.append([input(), input()])

def logic(n, h, diffs):
	diffs_sum = 0
	for step in range(0, n - 1):
		if diffs_sum + (n - step) * diffs[step] >= h:
			x = (h - diffs_sum) // (n - step)
			y = (h - diffs_sum) % (n - step)
			return [x + 1, x][y == 0]
		diffs_sum += diffs[step]
	return h - diffs_sum
for i in inp:
	[n, h] = [int(x) for x in i[0].split()]
	arr = [int(x) for x in i[1].split()]
	diffs = []
	i = arr[0]
	for j in arr[1:]:
		diffs.append(j - i)
		i = j
	diffs.sort()
	print(logic(n, h, diffs))


def cal_damage(arr, k):
	ans = 0
	n = len(arr)
	for i in range(0, n - 1):
		pre = arr[i]
		nxt = arr[i + 1]
		if pre + k > nxt:
			ans += nxt - pre
		else:
			ans += k
	ans += k
	return ans

def main():
	(n, h) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	(left, right) = (0, h)
	while left < right:
		mid = (left + right) // 2
		val = cal_damage(arr, mid)
		if h == val:
			break
		elif val < h:
			left = mid + 1
		else:
			right = mid
	ans1 = mid
	cal1 = cal_damage(arr, ans1)
	ans2 = mid + 1
	cal2 = cal_damage(arr, ans2)
	if cal1 >= h:
		return ans1
	else:
		return ans2
	return mid
for _ in range(int(input())):
	a = main()
	print(a)


def bp(array, b):
	left = 1
	right = 10 ** 18
	midlle = 0
	while left + 1 < right:
		pp = 0
		middle = (left + right) // 2
		for i in array:
			pp += min(i, middle)
		pp += middle
		if pp > b:
			right = middle
		else:
			left = middle
	return right
t = int(input())
for i in range(t):
	ty = input().split()
	n = int(ty[0])
	h = int(ty[1])
	array = list(map(int, input().split()))
	n_arr = []
	for i in range(len(array) - 1):
		n_arr.append(array[i + 1] - array[i])
	res = bp(n_arr, h)
	x = 0
	res -= 1
	for i in n_arr:
		x += min(i, res)
	x += res
	if x < h:
		res += 1
	print(res)


from queue import Queue
t = int(input())
ans = []
for _ in range(t):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	diff = []
	for i in range(1, n):
		diff.append(a[i] - a[i - 1])
	diff.sort()
	que = Queue()
	for d in diff:
		que.put(d)
	while not que.empty():
		if h <= que.queue[0] * (que.qsize() + 1):
			ans.append(int(h / (que.qsize() + 1)) + (h % (que.qsize() + 1) > 0))
			break
		h -= que.get()
	else:
		ans.append(h)
for i in ans:
	print(i)


tests = int(input())
for i in range(tests):
	[n, h] = list(map(int, input().split()))
	attacks = list(map(int, input().split()))
	damages = sorted((l - j for (j, l) in zip(attacks, attacks[1:])))
	tmp = 0
	for k in damages:
		if k > (h - tmp) // n:
			break
		tmp += k
		n -= 1
	print(0 - (tmp - h) // n)


t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	m = list(map(int, input().split()))
	ma = []
	pr = m[0]
	for i in m[1:]:
		ma.append(i - pr)
		pr = i
	ma.append(10 ** 18)
	l = 0
	r = h
	ans = (l + r) // 2
	while r - l > 1:
		ans = (l + r) // 2
		s = 0
		for i in ma:
			s += min(ans, i)
		if s < h:
			l = ans
		else:
			r = ans
	print(r)


t = int(input())
for _ in range(t):
	(n, damage) = map(int, input().split())
	time = list(map(int, input().split()))
	diffs = []
	for i in range(n - 1):
		diffs.append(abs(time[i + 1] - time[i]))

	def adder(mid):
		sum = 0
		for i in range(len(diffs)):
			if diffs[i] < mid:
				sum += diffs[i]
			else:
				sum += mid
		return sum + mid
	start = 1
	end = damage
	while start <= end:
		mid = start + (end - start) // 2
		if adder(mid) < damage:
			start = mid + 1
		elif adder(mid) >= damage:
			end = mid - 1
			ans = mid
	print(ans)


import math
t = int(input())
for _ in range(t):
	(n, h) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	dists = [0] * len(arr)
	for i in range(1, n):
		dists[i - 1] = arr[i] - arr[i - 1]
	dists[-1] = h
	low = math.ceil(h / n)
	high = h
	while low <= high:
		mid = (low + high) // 2
		damage = 0
		for i in range(n):
			damage += min(mid, dists[i])
		if damage < h:
			low = mid + 1
		else:
			high = mid - 1
	print(low)