#P17577. [JAG 2026 Summer Camp #3] vs Hydra
[JAG 2026 Summer Camp #3] vs Hydra
Problem Description
A Hydra with heads has appeared. The -th head initially has health points.
You may perform attacks any number of times, including zero. In each attack, choose one of the following types:
- Attack (): Decrease the health points of the -th head by .
- Attack : Decrease the health points of every head by .
Find the minimum number of attacks required to make the health points of every head at most .
Input Format
The input contains one or more test cases. The first line of the input contains an integer (), which is the number of test cases. The descriptions of the test cases follow, each in the following format.
N X Y
H_1 H_2 ... H_N
For each test case, the first line contains three integers , , and (, ), representing the number of heads, the damage dealt by Attack (), and the damage dealt by Attack , respectively.
The second line contains integers (), where represents the initial health points of the -th head.
The sum of over all test cases does not exceed .
Output Format
For each test case, print a single integer representing the minimum number of attacks required to make the health points of every head at most .
2
3 5 2
12 6 17
1 998244353 1000000007
1000000007
7
1