After founding his competitive programming company BaCoder, baluteshih saw rapid business growth and soon expanded into various services. One of the most important services offered is problem setting for programming contests — especially for clients who want to host a contest but lack the ability to write good problems themselves.
This job isn't easy. Besides ensuring that the problems are interesting and meet the client's desired difficulty, every detail must be carefully checked. To guarantee quality, BaCoder has a strict internal problem verification workflow. For a contest with $$$N$$$ problems, each problem has:
When assigning roles, suppose there are $$$M$$$ people participating in this contest preparation, labeled from $$$1$$$ to $$$M$$$. First, the setter for each problem is decided. Then, if someone is the setter for $$$x$$$ problems, they must also serve as the primary tester for $$$x$$$ problems and secondary tester for another $$$x$$$ problems.
Assigning testers is tricky — doing it manually often leads to mistakes like assigning the same person as both testers, or assigning the setter to test their own problem. baluteshih finds this frustrating. To improve efficiency, he asks you to write a program that assigns testers such that:
The first line contains an integer $$$T$$$, the number of test cases.
For each test case, the first line contains two integers $$$N$$$ and $$$M$$$: the number of problems and the number of participants.
The second line contains $$$N$$$ integers $$$s_1, s_2, \dots, s_N$$$, where $$$s_i$$$ is the ID of the setter for the $$$i$$$-th problem.
For each test case, if no valid tester assignment exists, output a single line containing No.
Otherwise, output three lines:
Your output will be considered correct if it satisfies all of the following conditions:
4 5 5 1 2 3 4 5 6 3 1 1 2 2 3 3 10 5 3 1 4 1 5 2 4 5 3 1 3 1 1 1 1
Yes 2 3 4 5 1 3 4 5 1 2 Yes 2 2 3 3 1 1 3 3 1 1 2 2 Yes 4 3 5 3 1 1 2 1 5 4 2 4 1 5 4 3 1 3 1 5 No