#P1896C. Matching Arrays

    ID: 8868 Type: RemoteJudge 2000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 4 Uploaded By: Tags>binary searchconstructive algorithmsgreedysortings*1400

Matching Arrays

No submission language available for this problem.

Description

You are given two arrays aa and bb of size nn. The beauty of the arrays aa and bb is the number of indices ii such that ai>bia_i > b_i.

You are also given an integer xx. Determine whether it is possible to rearrange the elements of bb such that the beauty of the arrays becomes xx. If it is possible, output one valid rearrangement of bb.

Each test contains multiple test cases. The first line contains the number of test cases tt (1t1041 \le t \le 10^4). The description of the test cases follows.

The first line of each test case contains two integers nn and xx (1n21051 \le n \le 2\cdot 10^5, 0xn0 \le x \le n) — the size of arrays aa and bb and the desired beauty of the arrays.

The second line of each test case contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (1ai2n1 \le a_i \le 2n) — the elements of array aa.

The third line of each test case contains nn integers b1,b2,,bnb_1, b_2, \ldots, b_n (1bi2n1 \le b_i \le 2n) — the elements of array bb.

It is guaranteed that the sum of nn over all test cases does not exceed 21052\cdot 10^5.

For each test case, output "NO" if it is not possible to rearrange bb to make the beauty of the arrays equal to xx.

Otherwise, output "YES". Then, on the next line, output nn integers which represent the rearrangement of bb.

If there are multiple solutions, you may output any of them.

You can output "YES" and "NO" in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1t1041 \le t \le 10^4). The description of the test cases follows.

The first line of each test case contains two integers nn and xx (1n21051 \le n \le 2\cdot 10^5, 0xn0 \le x \le n) — the size of arrays aa and bb and the desired beauty of the arrays.

The second line of each test case contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (1ai2n1 \le a_i \le 2n) — the elements of array aa.

The third line of each test case contains nn integers b1,b2,,bnb_1, b_2, \ldots, b_n (1bi2n1 \le b_i \le 2n) — the elements of array bb.

It is guaranteed that the sum of nn over all test cases does not exceed 21052\cdot 10^5.

Output

For each test case, output "NO" if it is not possible to rearrange bb to make the beauty of the arrays equal to xx.

Otherwise, output "YES". Then, on the next line, output nn integers which represent the rearrangement of bb.

If there are multiple solutions, you may output any of them.

You can output "YES" and "NO" in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

Sample Input 1

7
1 0
1
2
1 1
1
2
3 0
2 4 3
4 1 2
3 1
2 4 3
4 1 2
3 2
2 4 3
4 1 2
3 3
2 4 3
4 1 2
5 2
6 4 5 6 2
9 7 9 1 1

Sample Output 1

YES
2
NO
NO
YES
2 4 1
YES
4 1 2
NO
YES
1 9 9 7 1

Note

In test cases 1 and 2, the beauty of the arrays has to be 00 since a1=12=b1a_1 = 1 \le 2 = b_1.

In test cases 3, 4, 5 and 6, the only possible beauty of the arrays is x=1x = 1 and x=2x = 2. In particular, if bb is rearranged to [2,4,1][2, 4, 1], then a3=3>1=b3a_3 = 3 > 1 = b_3, so the beauty of the arrays is 11. If bb is kept in the same order as given the input, then a2=4>b2=1a_2 = 4 > b_2 = 1 and a3=3>2=b3a_3 = 3 > 2 = b_3, so the beauty of the arrays is 22.