logo AlgoBeat OnlineJudge
登录 注册

#217809. [JAG 2026 Summer Camp #3] vs Hydra

内存限制:2048 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 .

输入格式

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 .

输出格式

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 .

样例

样例输入 1

2
3 5 2
12 6 17
1 998244353 1000000007
1000000007

样例输出 1

7
1