308889: CF1592A. Gamer Hemose
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Gamer Hemose
题意翻译
你有 $n$ 种武器,每种武器使用一次可以造成 $a_i$ 的伤害,并且同一种武器不能连续用两次(但是**可以重复使用**)。现在有一个 HP 为 $H$ 的遗迹守卫,问你最少多少次A掉它。 Translated by [Tony102](https://tony102.com/)题目描述
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?输入输出格式
输入格式
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 $ .
输出格式
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.
输入输出样例
输入样例 #1
3
2 4
3 7
2 6
4 2
3 11
2 1 7
输出样例 #1
1
2
3