Permutation Transformation

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Fedor works in the department of permutation transforming. Today Fedor should solve the following problem: he needs to transform the permutation \[p_1,p_2,,p_n]\[p\_1, p\_2, \ldots, p\_n] of integers 1,2,,n1, 2, \ldots, n to the permutation \[q_1,q_2,,q_n]\[q\_1, q\_2, \ldots, q\_n] using at most n3n^3 kk-transfer operations.

Consider an array of length nn. The kk-transfer operation with the parameters (a,b)(a, b) is defined as follows: a segment of kk consecutive elements starting with an element at index aa is cut away from the array and inserted back starting with the index bb

More formally: consider an array \[t_1,t_2,,t_n]\[t\_1, t\_2, \ldots, t\_n] and two integers aa and bb (1a,bnk+11 \le a, b \le n - k + 1). Let's create the temporary array \[r_1,r_2,,r_nk]\[r\_1, r\_2, \ldots, r\_{n - k}], consisting of the numbers \[t_1,t_2,,t_a1,t_a+k,t_a+k+1,,t_n]\[t\_1, t\_2, \ldots, t\_{a - 1}, t\_{a + k}, t\_{a + k + 1}, \ldots, t\_n]. Then the result of the kk-transfer with parameters (a,b)(a, b) for an array tt is an array, consisting of the numbers \[r_1,r_2,,r_b1,t_a,t_a+1,,t_a+k1,r_b,r_b+1,,r_nk]\[r\_1, r\_2, \ldots, r\_{b - 1}, t\_a, t\_{a + 1}, \ldots, t\_{a + k - 1}, r\_b, r\_{b + 1}, \ldots, r\_{n - k}].

Fedor doesn't know how to solve the task, so he asks you to help him!

You are to solve the problem for tt test cases.

입력

The first line contains a single integer tt (1t1001 \le t \le 100) --- the number of test cases. 

Each test case consists of three lines. The first line contains two integers nn and kk (1kn1001 \le k \le n \le 100).

The second line contains nn different integers p_1,p_2,,p_np\_1, p\_2, \ldots, p\_n (1p_in1 \le p\_i \le n) --- the permutation pp.

The third line contains nn different integers q_1,q_2,,q_nq\_1, q\_2, \ldots, q\_n (1q_in1 \le q\_i \le n) --- the permutation qq.

It's guaranteed that the sum of nn over all test cases doesn't exceed 100100.

출력

Print the answer for each test case. Output your answer for a single test case in the following format.

If it's impossible to obtain a permutation q_1,q_2,,q_nq\_1, q\_2, \ldots, q\_n from a permutation p_1,p_2,,p_np\_1, p\_2, \ldots, p\_n using kk-transfers, print a single line consisting of the word "NO". 

Otherwise, print "YES" at the first line. 

The second line must contain a single integer mm --- the number of kk-transfers performed to obtain the permutation qq from the permutation pp (0mn30 \le m \le n^3). Note that you don't need to minimize mm. It's guaranteed that if the permutation qq can be obtained from the permutation pp using kk-transfers, then there is a solution that requires at most n3n^3 operations. 

Each of the following mm lines should contain two integers --- parameters aa and bb for the corresponding kk-transfer.

힌트

In the third test case there is another way to obtain a permutation qq from a permutation pp --- a single kk-transfer with the parameters a=2a = 2, b=1b = 1.