Jiubei and Overwatch
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

It's high noon!
Jiubei loves playing Overwatch even if it is a long time since the last update. Now he is using a damage skill to kill enemies.
The skill will damage all enemies simultaneously and the damage is determined by the time Jiubei charges this skill. The skill has a charging period division number k, and two damage increase numbers x,y. If he charged for t seconds, the damage is calculated as follows:
  • If , the damage is .
  • Otherwise, the damage is
Jiubei has n enemies, and the i-th enemy's health is a_i.
Please tell Jiubei how long it takes to charge his skill to kill all of his enemies.Note that the skill can only be used once.
Additionally, an enemy is killed if and only if his health is not greater than the damage he/she take.

输入描述:

The first line contains a single integer  --- the number of test cases.
The first line of each test case contains four integers --- the number of enemies, the number of charging period division, the numbers of damage increase respectively.
The second line of each test case contains n integers --- the health of enemies.

输出描述:

For each test case, output a single integer in a line, indicating the minimum time Jiubei needs to charge his skill to kill all enemies.
示例1

输入

复制
2
3 2 4 3
1 2 5
3 2 4 3
1 5 21

输出

复制
2
7