Problem: Phoenix has blocks of height , and all don't exceed some value . He plans to stack all blocks into separate towers. The height of a tower is simply the sum of the heights of its blocks. For the towers to look beautiful, no two towers may have a height difference of strictly more than .
Please help Phoenix build towers that look beautiful. Each tower must have at least one block and all blocks must be used.
Input Format: The input consists of multiple test cases. The first line contains an integer () — the number of test cases.
The first line of each test case contains three integers , , and (; ) — the number of blocks, the number of towers to build, and the maximum acceptable height difference of any two towers, respectively.
The second line of each test case contains space-separated integers () — the heights of the blocks.
It is guaranteed that the sum of over all the test cases will not exceed .
Output Format: For each test case, if Phoenix cannot build towers that look beautiful, print NO. Otherwise, print YES, followed by integers , where () is the index of the tower that the -th block is placed in.
If there are multiple solutions, print any of them.
Note: In the first test case, the first tower has height and the second tower has height . Their difference is which doesn't exceed , so the towers are beautiful.
In the second test case, the first tower has height , the second tower has height , and the third tower has height . The maximum height difference of any two towers is which doesn't exceed , so the towers are beautiful.