题目描述
Read problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.
You are given a sequence $A_{1}, A_{2}, \ldots, A_{N}$ and an integer $K$. Determine if it is possible to reorder the elements of the sequence $A$ into a sequence $B_{1}, B_{2}, \ldots, B_{N}$ and choose a real number $m$ in such a way that for each contiguous subsequence of $B$ with length $K$, the arithmetic average of the elements of this subsequence is $m$. If it is possible, find one such reordered subsequence $B$.
------ Input ------
The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
The first line of each test case contains two space-separated integers $N$ and $K$.
The second line contains $N$ space-separated integers $A_{1}, A_{2}, \ldots, A_{N}$.
------ Output ------
For each test case, print a single line containing the string "YES" if it is possible to reorder the elements of $A$ in the required way, or "NO" otherwise.
If it is possible, print a second line containing $N$ space-separated integers $B_{1}, B_{2}, \ldots, B_{N}$. If there are multiple solutions, you may print any one.
------ Constraints ------
$1 ≤ T ≤ 1,000$
$1 ≤ K ≤ N ≤ 10^{5}$
$1 ≤ A_{i} ≤ 10^{6}$
the sum of $N$ over all test cases does not exceed $10^{6}$
------ Subtasks ------
Subtask #1 (40 points):
$N ≤ 1,000$
the sum of $N$ over all test cases does not exceed $10,000$
Subtask #2 (60 points): original constraints
------ Example Input ------
2
5 3
1 1 2 2 3
6 2
1 1 1 1 1 2
------ Example Output ------
YES
1 2 3 1 2
NO
输入格式
见题面
输出格式
见题面