BETA

Submissions : 3413 Accuracy :

41.66

Swap kth elements
     

Given an array, swap kth element from beginning with kth element from end.

Input:

The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N and k,N is the size of array and kth number.
The second line of each test case contains N input C[i].

Output:

Print the modified array.

Constraints:

1 ≤ T ≤ 100
1 ≤ K ≤ N ≤ 500
1 ≤ C[i] ≤ 1000

Example:

Input
1
8 3
1 2 3 4 5 6 7 8

Output
1 2 6 4 5 3 7 8

 

**For More Examples Use Expected Output**


Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.