[1 and 2 are completely different problems. Consider reading both.]
The monsters are back again. Harry and Hermione are fighting the monsters. There are monsters, and their health point is described by an array consisting of positive integers. A monster is dead when its health point becomes non-positive ().
To fight these monsters, Harry knows a spell which can be casted over a single monster and has power . On the other hand, Hermione knows a spell which can be casted over multiple monsters and has power .
Initially, and is given in the input.
Starting from day , the following happens in each day in the order mentioned:
1. Harry selects a monster, and deals damage to that monster. [It is possible to select a monster which is already dead]
2. Hermione casts her spell over all the other monsters (excluding the one Harry selected) and deals damage to each of these monsters.
3. is increased by .
4. is increased by .
If Harry and Hermione fight optimally, calculate the minimum number of days needed to kill all the monsters.
The first line of the input contains a single integer — the number of test cases.
Each test case consists of two lines. The first line contains two integers and — the number of monsters and initial power of Harrys spell respectively.
The second line contains integers — initial health point of each monster.
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, print a single integer — minimum number of days needed to kill all the monsters.
Input | Output |
---|---|
4 4 7 2 2 8 10 3 6 3 3 9 2 3 3 10 1 5 2 | 3 2 3 1 |
Explanation of test case : Starting of day : , , 1. Select monster, decrease its health by . . 2. Decrease health of each monster by , excluding the monster. . 3. 4. Starting of day : , , 1. Select monster. . 2. Decrease health of each monster by , excluding the monster. . 3. 4. Starting of day : , , 1. Select monster . 2. Decrease health of each monster by , excluding the monster. . 3. 4. All the monsters are dead after days. |