One day, Ahmed_Hossam went to Hemose and said "Let's solve a gym contest!". Hemose didn't want to do that, as he was playing Valorant, so he came up with a problem and told it to Ahmed to distract him. Sadly, Ahmed can't solve it... Could you help him?

There is an Agent in Valorant, and he has $n$ weapons. The $i$-th weapon has a damage value $a_i$, and the Agent will face an enemy whose health value is $H$.

The Agent will perform one or more moves until the enemy dies.

In one move, he will choose a weapon and decrease the enemy's health by its damage value. The enemy will die when his health will become less than or equal to $0$. However, not everything is so easy: the Agent can't choose the same weapon for $2$ times in a row.

What is the minimum number of times that the Agent will need to use the weapons to kill the enemy?


-----Input-----

Each test contains multiple test cases. The first line contains the number of test cases $t$ $(1 \leq t \leq 10^5)$. Description of the test cases follows.

The first line of each test case contains two integers $n$ and $H$ $(2 \leq n \leq 10^3, 1 \leq H \leq 10^9)$ — the number of available weapons and the initial health value of the enemy.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ $(1 \leq a_i \leq 10^9)$ — the damage values of the weapons.

It's guaranteed that the sum of $n$ over all test cases doesn't exceed $2 \cdot 10^5$.


-----Output-----

For each test case, print a single integer — the minimum number of times that the Agent will have to use the weapons to kill the enemy.


-----Examples-----

Input
3
2 4
3 7
2 6
4 2
3 11
2 1 7
Output
1
2
3


-----Note-----

In the first test case, the Agent can use the second weapon, making health value of the enemy equal to $4-7=-3$. $-3 \le 0$, so the enemy is dead, and using weapon $1$ time was enough.

In the second test case, the Agent can use the first weapon first, and then the second one. After this, the health of enemy will drop to $6-4-2 = 0$, meaning he would be killed after using weapons $2$ times.

In the third test case, the Agent can use the weapons in order (third, first, third), decreasing the health value of enemy to $11 - 7 - 2 - 7 = -5$ after using the weapons $3$ times. Note that we can't kill the enemy by using the third weapon twice, as even though $11-7-7<0$, it's not allowed to use the same weapon twice in a row.

Difficulty: EASY

Solutions:
t = int(input())
for _ in range(t):
	(n, H) = map(int, input().split())
	weapons = sorted(list(map(int, input().split())))
	ans = H // (weapons[-1] + weapons[-2]) * 2
	H %= weapons[-1] + weapons[-2]
	if H > 0:
		if H > weapons[-1]:
			ans += 2
		else:
			ans += 1
	print(ans)


for i in range(int(input())):
	(n, h) = map(int, input().split())
	A = [int(k) for k in input().split()]
	A.sort()
	a = 0
	l = A[-1] + A[-2]
	j = h // l
	o = h % l
	if o == 0:
		print(j * 2)
	elif o <= A[-1]:
		print(j * 2 + 1)
	else:
		print(j * 2 + 2)


t = int(input())
for _ in range(t):
	(n, H) = map(int, input().split())
	weapon_damages = sorted(map(int, input().split()))
	used_weapon_1 = weapon_damages[-1]
	used_weapon_2 = weapon_damages[-2]
	used_weapon_damage = used_weapon_1 + used_weapon_2
	res = H // used_weapon_damage * 2
	if H % used_weapon_damage > 0:
		if H % used_weapon_damage <= used_weapon_1 or H % used_weapon_damage <= used_weapon_2:
			res += 1
		else:
			res += 2
	print(res)


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort()
	xx = h // (a[-1] + a[-2])
	h -= xx * (a[-1] + a[-2])
	cnt = 2 * xx
	if h > 0:
		cnt += 1
		h -= a[-1]
	if h > 0:
		cnt += 1
		h -= a[-2]
	print(cnt)


t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	times = 0
	temp = a[0] + a[1]
	if h % temp == 0:
		print(h // temp * 2)
	elif h % temp == h:
		if h > a[0]:
			print(2)
		else:
			print(1)
	elif h % temp > 0:
		if h % temp <= a[0]:
			print(h // temp * 2 + 1)
		else:
			print(h // temp * 2 + 2)


tests = int(input())
for _ in range(0, tests):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr.sort()
	both = arr[-1] + arr[-2]
	if h <= arr[-1]:
		print(1)
	else:
		if h % both == 0:
			ans1 = h // both * 2
		else:
			ans1 = (h // both + 1) * 2
		if (h + arr[-2]) % both == 0:
			ans2 = 2 * ((h + arr[-2]) // both) - 1
		else:
			ans2 = 2 * ((h + arr[-2]) // both + 1) - 1
		if ans1 > ans2:
			print(ans2)
		else:
			print(ans1)


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	a = l[0]
	b = l[1]
	c = a + b
	r = h % c
	if r == 0:
		print(2 * (h // c))
	elif r <= a:
		print(2 * (h // c) + 1)
	else:
		print(2 * (h // c) + 2)


from collections import Counter, deque
import math
from random import randint
from bisect import bisect
import sys
import re
MOD = 1000000007
MAX = sys.maxsize
MIN = -sys.maxsize

class get:

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

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

	def float():
		return list(map(float, input().split()))

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

def sqrt(x):
	return int(math.sqrt(x)) + 1

def gcd(*args):
	result = args[0]
	for item in args:
		result = math.gcd(result, item)
	return result

def LCM(a, b):
	return a * b // math.gcd(a, b)

def solve():
	(n, H) = get.map()
	a = get.int()
	a.sort()
	r = H % (a[-1] + a[-2])
	res = H // (a[-1] + a[-2])
	res = 2 * res
	if r != 0:
		if r <= a[-1]:
			res += 1
		else:
			res += 2
	print(res)
for _ in range(int(input())):
	solve()


from math import ceil
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort()
	ans = ceil(h / (a[-1] + a[-2])) * 2
	if h - (ans // 2 * (a[-1] + a[-2]) - a[-2]) <= 0:
		ans -= 1
	print(ans)


for fgbhjm in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort()
	x = a[-1]
	y = a[-2]
	ans = h // (x + y)
	if h <= x:
		print(1)
	elif h % (x + y) == 0:
		print(ans * 2)
	elif ans * (x + y) + x >= h:
		print(ans * 2 + 1)
	else:
		print(ans * 2 + 2)


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	s = sorted(list(map(int, input().split())), reverse=True)
	su = s[0] + s[1]
	print(m // su * 2 + (0 if m % su == 0 else 1 if m % su <= s[0] else 2))


def f():
	(n, h) = map(int, input().split())
	l = sorted(map(int, input().split()), reverse=True)
	(a, b) = (l[0], l[1])
	t = 1
	c = 2 * (h // (a + b))
	h %= a + b
	if h > a:
		c += 2
	elif h:
		c += 1
	return c
for _ in range(int(input())):
	print(f())


for _ in range(int(input())):
	(n, m) = map(int, input().split(' '))
	l = list(map(int, input().split(' ')))
	l.sort()
	a = l[len(l) - 1]
	b = l[len(l) - 2]
	c = a + b
	h = m // c
	d = m % c
	if h * c == m:
		print(h * 2)
	elif d <= a or d <= b:
		print(h * 2 + 1)
	else:
		print(h * 2 + 2)


def count_shots(aa, H):
	if len(aa) == 1:
		return (H + aa[0] - 1) // aa[0]
	else:
		aa.sort()
		v1 = aa[-1]
		v2 = aa[-2]
		count = H // (v1 + v2)
		H -= (v1 + v2) * count
		count *= 2
		while H > 0:
			v = v2 if count % 2 == 1 else v1
			H -= v
			count += 1
		return count
	return 0
n_t = int(input())
for t in range(n_t):
	(n, H) = map(int, input().split(' '))
	aa = list(map(int, input().split(' ')))
	assert len(aa) == n
	result = count_shots(aa, H)
	print(result)


def game(a, h):
	n = len(a)
	mx1 = 0
	mx2 = 0
	for i in range(n):
		if a[i] >= mx1:
			mx2 = mx1
			mx1 = a[i]
		elif a[i] < mx1 and a[i] >= mx2:
			mx2 = a[i]
	if h <= mx1:
		return 1
	if h <= mx1 + mx2:
		return 2
	temp = h % (mx1 + mx2)
	ans = h // (mx1 + mx2)
	ans = ans * 2
	if temp == 0:
		return ans
	if temp <= mx1:
		return ans + 1
	return ans + 2
t = int(input())
for i in range(t):
	(n, h) = input().split()
	n = int(n)
	h = int(h)
	a = [int(x) for x in input().split()]
	print(game(a, h))


for i in range(int(input())):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr.sort()
	a = arr[-1]
	b = arr[-2]
	ans = h // (a + b) * 2
	h %= a + b
	if h == 0:
		print(ans)
	elif h - a <= 0:
		print(ans + 1)
	else:
		print(ans + 2)


t = int(input())
for i in range(t):
	(n, h) = map(int, input().split())
	n_ = list(map(int, input().split()))
	n_.sort(reverse=True)
	x = n_[0] + n_[1]
	y = int(h / x)
	z = h % x
	res = 2 * y
	if z == 0:
		pass
	elif z <= n_[0]:
		res += 1
	else:
		res += 2
	print(res)


t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	count = 0
	a.sort()
	if a[-1] >= h:
		print(1)
	elif a[-1] + a[-2] >= h:
		print(2)
	else:
		s = a[-1] + a[-2]
		f = h % s
		if f == 0:
			print(h // s * 2)
		elif f <= a[-1]:
			print(h // s * 2 + 1)
		else:
			print(h // s * 2 + 2)


import math
t = int(input())
for _ in range(t):
	(_, h) = [int(c) for c in input().split(' ')]
	a = [int(c) for c in input().split(' ')]
	m = max(a)
	if h <= m:
		print(1)
		continue
	k = 0
	a.remove(m)
	sm = max(a)
	k = math.floor(h / (m + sm))
	h = h % (m + sm)
	if h == 0:
		print(k * 2)
		continue
	if h <= m:
		print(k * 2 + 1)
		continue
	else:
		print(k * 2 + 2)


p = int(input())
while p:
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort()
	d = a[n - 1] + a[n - 2]
	b = h // d
	c = h % d
	e = 0
	if c > a[n - 1] and c != 0:
		e += 2
	elif c != 0:
		e += 1
	e += 2 * b
	print(e)
	p -= 1


import math
t = int(input())
for i in range(t):
	(n, H) = map(int, input().split())
	A = list(map(int, input().split()))
	maxim1 = max(A)
	A[A.index(maxim1)] = 0
	maxim2 = max(A)
	maxim = maxim1 + maxim2
	if H // maxim == math.ceil(H / maxim):
		print(2 * (H // maxim))
	elif maxim * (H // maxim) + maxim1 >= H:
		print(2 * (H // maxim) + 1)
	else:
		print(2 * (H // maxim) + 2)


import math
import heapq
T = int(input())
for _ in range(T):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr.sort()
	x = arr[-1] + arr[-2]
	z = h // x
	cnt = 0
	if h % x == 0:
		cnt = z * 2
	elif h % x <= arr[-1]:
		cnt = z * 2 + 1
	elif h % x > arr[-1]:
		cnt = z * 2 + 2
	print(cnt)


x = int(input())
for i in range(x):
	h = input().split(' ')
	w = input().split(' ')
	H = list(map(int, h))
	W = list(map(int, w))
	W.sort()
	if H[1] <= W[-1]:
		print(1)
	elif H[1] <= W[-1] + W[-2]:
		print(2)
	elif H[1] % (W[-1] + W[-2]) == 0:
		print(int(H[1] / (W[-1] + W[-2])) * 2)
	elif H[1] % (W[-1] + W[-2]) <= W[-1]:
		print(int(H[1] / (W[-1] + W[-2])) * 2 + 1)
	else:
		print(int(H[1] / (W[-1] + W[-2])) * 2 + 2)


t = int(input())
for _ in range(t):
	(n, H) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort()
	l = a[-1]
	s = a[-2]
	if H <= l:
		print(1)
	elif H <= l + s:
		print(2)
	else:
		ans = 2 * (H // (l + s))
		h = ans // 2 * (l + s)
		while h < H:
			h += l
			ans += 1
			if h < H:
				h += s
				ans += 1
		print(ans)


t = int(input())
while t:
	t -= 1
	(n, h) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	a.sort()
	(x, y) = (a[-1], a[-2])
	s = x + y
	u = h // s
	u = u * 2
	if h % s != 0:
		r = h % s
		if r <= x or r <= y:
			u += 1
		else:
			u += 2
	print(u)


for t in range(int(input())):
	(n, H) = [int(i) for i in input().split()]
	a = sorted([int(i) for i in input().split()])
	if a[-1] >= H:
		res = 1
	elif a[-1] + a[-2] >= H:
		res = 2
	else:
		b = H % (a[-1] + a[-2])
		if b == 0:
			res = H // (a[-1] + a[-2]) * 2
		elif b <= a[-1]:
			res = H // (a[-1] + a[-2]) * 2 + 1
		else:
			res = H // (a[-1] + a[-2]) * 2 + 2
	print(res)


total_tests = int(input())
from math import ceil
for i in range(total_tests):
	m = 0
	(n, H) = list(map(int, input().split(' ')))
	st = list(map(int, input().split(' ')))
	max1 = max(st)
	st.remove(max1)
	max2 = max(st)
	m = 2 * (H // (max1 + max2))
	if H % (max1 + max2) > max1:
		m += 2
	elif H % (max1 + max2) == 0:
		m += 0
	else:
		m += 1
	print(m)


t = int(input())
for i in range(t):
	(n, H) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	a.sort()
	first = a[-1]
	second = a[-2]
	if first >= H:
		print(1)
	elif first + second >= H:
		print(2)
	else:
		rem = H // (first + second)
		mod = H % (first + second)
		if mod == 0:
			print(2 * rem)
		elif mod <= first:
			print(2 * rem + 1)
		else:
			print(2 * rem + 2)


for i in range(int(input())):
	(n, H) = map(int, input().split())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	(i, count) = (0, 0)
	if H <= l[0]:
		print('1')
	else:
		q = H // (l[0] + l[1])
		if H % (l[0] + l[1]) == 0:
			print(2 * q)
		elif H % (l[0] + l[1]) <= l[0]:
			print(2 * q + 1)
		else:
			print(2 * q + 2)


def solve():
	(n, h) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	a.sort()
	x = a[n - 1]
	y = 0
	if n >= 2:
		y = a[n - 2]
	k = int(h / (x + y))
	h = h - k * (x + y)
	cnt = k * 2
	if h > 0:
		cnt = cnt + 1
		h -= x
	if h > 0:
		cnt = cnt + 1
		h -= y
	print(cnt)
test = int(input())
while test > 0:
	test = test - 1
	solve()


t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	(x, y, *z) = sorted(map(int, input().split()), reverse=True)
	s = x + y
	(d, r) = (h // s, h % s)
	ans = d * 2
	if r > x:
		ans += 2
	elif r > 0:
		ans += 1
	print(ans)


t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr.sort()
	m1 = arr[-1]
	m2 = arr[-2]
	if m1 >= h:
		print(1)
	else:
		p = m1 + m2
		(q, rem) = (h // p, h % p)
		if rem > 0:
			if rem <= m1:
				print(2 * q + 1)
			else:
				print(2 * q + 2)
		else:
			print(2 * q)


def mini(list1):
	mx = max(list1[0], list1[1])
	secondmax = min(list1[0], list1[1])
	n = len(list1)
	for i in range(2, n):
		if list1[i] > mx:
			secondmax = mx
			mx = list1[i]
		elif list1[i] > secondmax:
			secondmax = list1[i]
	return (mx, secondmax)
t = int(input())
c = 0
for i in range(t):
	(n, h) = map(int, input().split())
	dmg = list(map(int, input().split()))
	(mx, secondmx) = mini(dmg)
	if h <= mx:
		print(1)
	elif h % (mx + secondmx) == 0:
		print(2 * (h // (mx + secondmx)))
	else:
		q = 2 * (h // (mx + secondmx))
		r = h - q / 2 * (mx + secondmx)
		if r <= mx:
			print(q + 1)
		else:
			print(q + 2)


T = int(input())
while T:
	(n, H) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr.sort(reverse=True)
	at = arr[0] + arr[1]
	if H % at:
		if arr[0] < H % at:
			print(H // at * 2 + 2)
		else:
			print(H // at * 2 + 1)
	else:
		print(H // at * 2)
	T -= 1


def fun(ls, lt):
	(n, h) = lt
	ls = sorted(ls)
	mx = ls[-1]
	mn = ls[-2]
	sm = mx + mn
	times = h // sm * 2
	h = h % sm
	count = 0
	while h > 0:
		if count % 2 == 0:
			h -= mx
			times += 1
		else:
			h -= mn
			times += 1
		count += 1
	print(times)
T = int(input())
for i in range(T):
	lt = list(map(int, input().split()))
	ls = list(map(int, input().split()))
	fun(ls, lt)


def parse_n_solve():
	t = int(input())
	for i in range(t):
		(n, h) = list(map(int, input().split()))
		ais = list(map(int, input().split()))
		ais = sorted(ais, reverse=True)
		if ais[0] >= h:
			print(1)
		elif ais[0] + ais[1] >= h:
			print(2)
		else:
			mod = h % (ais[0] + ais[1])
			div = int(h / (ais[0] + ais[1]))
			if mod == 0:
				print(div * 2)
			elif mod > ais[0]:
				print(div * 2 + 2)
			else:
				print(div * 2 + 1)
parse_n_solve()


def gamer_hemose(H, a):
	best_damage = a[0] + a[1]
	s = H // best_damage * 2
	H %= best_damage
	if H > 0:
		s += 1
		H -= a[0]
	if H > 0:
		s += 1
	return s
t = int(input())
for _ in range(t):
	(n, H) = map(int, input().split(' '))
	a = sorted(map(int, input().split(' ')), reverse=True)
	print(gamer_hemose(H, a))


def solve(n, H, hps):
	hps = sorted(hps)
	(one, two) = (hps[-1], hps[-2])
	count = 0
	total = one + two
	if H > total:
		count += 2 * (H // total)
		H %= total
	if H > 0:
		H -= one
		count += 1
	if H > 0:
		H -= two
		count += 1
	return count

def main():
	testcases = int(input())
	for _ in range(testcases):
		(n, H) = [int(x) for x in input().split()]
		hps = [int(x) for x in input().split()]
		ans = solve(n, H, hps)
		print(ans)
main()


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort()
	an = 2 * (h // (a[-1] + a[-2]))
	if h % (a[-1] + a[-2]) == 0:
		print(an)
	elif h % (a[-1] + a[-2]) - a[-1] > 0:
		print(an + 2)
	else:
		print(an + 1)


def second_largest(numbers):
	m1 = m2 = float('-inf')
	for x in numbers:
		if x > m2:
			if x >= m1:
				(m1, m2) = (x, m1)
			else:
				m2 = x
	return [m1, m2]
for _ in range(int(input())):
	(n, h) = map(int, input().split())
	(*wep,) = map(int, input().split())
	wep = second_largest(wep)
	sm = wep[0] + wep[1]
	if h // sm:
		aa = h // sm
		s = aa * sm
		h -= s
		aa *= 2
		if h == 0:
			pass
		elif h > wep[0]:
			aa += 2
		else:
			aa += 1
		print(aa)
	elif h > wep[0]:
		print(2)
	else:
		print(1)


t = int(input())
while t > 0:
	t -= 1
	(a, b) = list(map(int, input().split()))
	li = [int(x) for x in input().split()]
	li.sort()
	count = 0
	add = li[a - 1] + li[a - 2]
	count += b // add
	ans = 2 * count
	left = b - add * count
	if left == 0:
		print(ans)
	else:
		if left > li[a - 1]:
			left -= li[a - 1]
			ans += 2
		else:
			ans += 1
		print(ans)


for i in range(int(input())):
	(n, h) = map(int, input().split())
	l = list(map(int, input().split()))
	l = sorted(l)
	count = 2 * (h // (l[n - 1] + l[n - 2]))
	a = h % (l[n - 1] + l[n - 2])
	if a == 0:
		count += 0
	elif a > l[n - 1]:
		count += 2
	else:
		count += 1
	print(count)


p = lambda : map(int, input().split())
(T,) = p()
for _ in range(T):
	(n, h) = p()
	(x, y) = sorted(p())[-2:]
	k = h // (x + y)
	h -= k * (x + y)
	print(2 * k + (2 if h > y else 1 if h else 0))


t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	m = l[0] + l[1]
	x = 2 * (h // m)
	h %= m
	if h > l[0]:
		x += 2
	elif h > 0:
		x += 1
	print(x)


def solve():
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	max1 = arr[n - 1]
	max2 = arr[n - 2]
	tot = max1 + max2
	ans = h // tot * 2
	h = h % tot
	if h > 0:
		h -= max1
		ans += 1
	if h > 0:
		h -= max2
		ans += 1
	print(ans)
t = int(input())
for i in range(t):
	solve()


for t in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	w1 = a[0]
	w2 = a[1]
	i = 0
	count = 0
	ans = 2 * (h // (w1 + w2))
	rem = h % (w1 + w2)
	if rem > 0:
		if w1 >= rem:
			ans += 1
		else:
			ans += 2
	print(ans)


t = int(input())
for i in range(t):
	(n, h) = map(int, input().split())
	a = [x for x in map(int, input().split())]
	a.sort()
	x = a[n - 1] + a[n - 2]
	c = 2 * (h // x)
	h = h % x
	if h > a[n - 1]:
		c += 2
	elif h > 0:
		c += 1
	print(c)


for step in range(int(input())):
	(n, H) = map(int, input().split())
	weapons = list(map(int, input().split()))
	weapons.sort()
	strongest = weapons[-1]
	secstrong = weapons[-2]
	ans = 0
	mog = H // (strongest + secstrong)
	ans += 2 * mog
	leftover = H % (strongest + secstrong)
	if 0 < leftover <= strongest:
		ans += 1
	elif leftover == 0:
		pass
	else:
		ans += 2
	print(ans)


for i in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort()
	a.reverse()
	if h % (a[0] + a[1]) == 0:
		print(h // (a[0] + a[1]) * 2)
	elif h % (a[0] + a[1]) <= a[0]:
		print(h // (a[0] + a[1]) * 2 + 1)
	else:
		print(h // (a[0] + a[1]) * 2 + 2)


Input = '\n3\n2 4\n3 7\n2 6\n4 2\n3 11\n2 1 7\n'[1:-1].split('\n')
t = int(input())
for i in range(t):
	(n, H) = map(int, input().split())
	a = sorted(map(int, input().split()), reverse=True)
	(A, B) = a[:2]
	(Count, H) = divmod(H, A + B)
	if H <= 0:
		print(Count * 2)
	elif H > A:
		print(Count * 2 + 2)
	else:
		print(Count * 2 + 1)


t = int(input())
for _ in range(t):
	(n, H) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	ans = H // (a[0] + a[1])
	H -= (a[0] + a[1]) * ans
	ans *= 2
	while H > 0:
		H -= a[ans % 2]
		ans += 1
	print(ans)


T = int(input())
for t in range(T):
	(n, H) = [int(k) for k in input().split(' ')]
	a = [int(k) for k in input().split(' ')]
	(M, m) = (0, 0)
	for k in a:
		if k >= M:
			m = M
			M = k
		elif k > m:
			m = k
	a = [M, m]
	ans = H // (M + m) * 2
	rem = H % (M + m)
	if rem == 0:
		print(ans)
	elif rem <= M:
		print(ans + 1)
	else:
		print(ans + 2)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	l = sorted(map(int, input().split()), reverse=True)
	(x, y) = (l[0], l[1])
	flag = 0
	c = 0
	ans = b // (x + y) * 2
	test = b % (x + y)
	if test > x:
		ans += 2
	elif test > 0:
		ans += 1
	print(ans)


for i in range(int(input())):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort()
	h = h - a[-1]
	count = 1
	if h > 0:
		h = h - a[-2]
		count += 1
		if h > 0:
			t = a[-1] + a[-2]
			count = count + 2 * (h // t)
			h = h % t
			if h > 0:
				h = h - a[-1]
				count += 1
				if h > 0:
					count += 1
	print(count)


import math
t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	l = [int(i) for i in input().split()]
	l.sort()
	s = l[-1] + l[-2]
	if l[-1] >= h:
		print('1')
	elif h % s == 0:
		print(h // s * 2)
	elif h % s <= l[-1]:
		print(h // s * 2 + 1)
	else:
		print(h // s * 2 + 2)


t = int(input())
for _ in range(t):
	(n, h) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr.sort(reverse=True)
	(a, b) = (arr[0], arr[1])
	count = 0
	total = a + b
	count += 2 * (h // total)
	rem = h % total
	if rem == 0:
		count += 0
	elif rem <= a:
		count += 1
	else:
		count += 2
	print(count)


t = int(input())
for _ in range(t):
	(n, H) = list(map(int, input().split()))
	damage = list(map(int, input().split()))
	damage.sort(reverse=True)
	d1 = damage[0]
	d2 = damage[1]
	if H <= d1:
		print(1)
	else:
		q = H // (d1 + d2)
		r = H % (d1 + d2)
		if r == 0:
			print(2 * q)
		elif r <= d1:
			print(2 * q + 1)
		else:
			print(2 * q + 2)


def main():
	t = int(input())
	for i in range(t):
		(n, H) = map(int, input().split())
		a = list(map(int, input().split()))
		a1 = max(a)
		del a[a.index(a1)]
		a2 = max(a)
		a = [a1, a2]
		co = 2 * (H // (a1 + a2))
		k = 2
		if H % (a1 + a2) != 0:
			co += 1
			if H % (a1 + a2) > a1:
				co += 1
		print(co)
main()


t = int(input())
for a in range(t):
	weapons_health = [int(i) for i in input().split()]
	damage = [int(j) for j in input().split()]
	damage = sorted(damage)
	H = weapons_health[1]
	gun_a = damage[-1]
	gun_b = damage[-2]
	dam = gun_a + gun_b
	if H % dam == 0:
		cnt = H // dam
	else:
		cnt = int(H / dam + 1)
	if dam * cnt - gun_b >= H:
		print(2 * cnt - 1)
	else:
		print(2 * cnt)


T = int(input())
while T > 0:
	(n, H) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	max1 = max(A)
	A.remove(max1)
	max2 = max(A)
	if H <= max1:
		print(1)
	elif H <= max1 + max2:
		print(2)
	else:
		val = int(H / (max1 + max2))
		count = val * 2
		if H - val * (max1 + max2) <= 0:
			print(count)
		else:
			rem = H - val * (max1 + max2)
			if rem <= max1:
				print(count + 1)
			else:
				print(count + 2)
	T = T - 1


R = lambda : map(int, input().split())
(t,) = R()
while t:
	t -= 1
	(n, h) = R()
	(*_, x, y) = sorted(R())
	s = x + y
	print(h // s * 2 + (h % s > 0) + (h % s > y))


for _ in range(int(input())):
	(n, h) = map(int, input().split())
	a = [int(x) for x in input().split()]
	a.sort(reverse=True)
	ans = 2 * (h // (a[0] + a[1]))
	h -= ans // 2 * (a[0] + a[1])
	if h > 0:
		ans += 1
		h -= a[0]
	if h > 0:
		ans += 1
		h -= a[1]
	print(ans)


for i in range(int(input())):
	health = int(input().split()[1])
	all_damages = input().split()
	all_damages = [int(x) for x in all_damages]
	if len(all_damages) == 1:
		print(1)
		continue
	max_damage = max(all_damages)
	all_damages.remove(max_damage)
	max2 = max(all_damages)
	counter = 0
	two_damages = max_damage + max2
	if two_damages < health:
		counter = health // two_damages * 2
		left = health % two_damages
		if left > 0:
			counter += 1
		if left > max_damage:
			counter += 1
	elif max_damage >= health:
		counter = 1
	else:
		counter = 2
	print(counter)


t = int(input())
for i in range(t):
	(n, H) = map(int, input().split())
	arr = sorted(list(map(int, input().split())))
	(a, b) = (arr[-1], arr[-2])
	ans = H // (a + b)
	H -= ans * (a + b)
	ans *= 2
	if H > a:
		ans += 2
	elif H != 0:
		ans += 1
	print(ans)


def main():

	def solve(n, h, a):
		b = c = -1
		for x in a:
			if x > b:
				c = b
				b = x
			elif x > c:
				c = x
		(q, r) = divmod(h, b + c)
		if r > b:
			return 2 * q + 2
		elif r > 0:
			return 2 * q + 1
		return 2 * q
	t = int(input())
	ans = []
	for _ in range(t):
		(n, h) = [int(x) for x in input().split()]
		a = [int(x) for x in input().split()]
		ans.append(solve(n, h, a))
	print('\n'.join(map(str, ans)))
import sys, threading
input = sys.stdin.readline
thread = threading.Thread(target=main)
thread.start()
thread.join()


from random import *
from math import *
T = int(input())
for t in range(T):
	(n, H) = map(int, input().split())
	A = list(map(int, input().split()))
	A.sort()
	ans = 0
	(a, b) = (A[-1], A[-2])
	ans += H // (a + b) * 2
	H %= a + b
	while H > 0:
		if ans % 2 == 0:
			H -= a
		else:
			H -= b
		ans += 1
	print(ans)


t = int(input())
for i in range(t):
	(n, h) = map(int, input().split())
	a = list(map(int, input().split()))
	a.sort()
	a1ma = a[-1]
	a2ma = a[-2]
	tma = a1ma + a2ma
	ans = h // tma
	mo = h % tma
	if mo == 0:
		print(ans * 2)
	elif mo <= a1ma:
		print(ans * 2 + 1)
	else:
		print(ans * 2 + 2)