


Swap 1: We swap adjacent elements 90 and 21. So, ARR after one swap is [70, 60, 21, 90, 11].
Swap 2: We swap adjacent elements 60 and 21. So, ARR after one swap is [70, 21, 60, 90, 11].
Swap 3: We swap adjacent elements 70 and 21. So, ARR after one swap is [21, 70, 60, 90, 11].
The lexicographically smallest ARR after K = 3 swaps is [21, 70, 60, 90, 11].
The first line of input contains an integer 'T' representing the number of test cases or queries to be processed. Then the test case follows.
The first line of each test case contains two single space-separated integers ‘N’ and ‘K’ representing the size of the array/list and the given integer, respectively.
The second line of each test case contains ‘N’ single space-separated integers representing the array elements.
For each test case, print the lexicographically smallest array/list obtained after at most K swaps.
You do not need to print anything; it has already been taken care of. Just implement the function.
1 <= T <= 100
1 <= N <= 5000
1 <= K <= 10^9
0 <= ARR[i] <= 10^5
Where 'ARR[i]' denotes the ith elements of the given array/list.
Time Limit: 1sec
Looking at the problem, we observe that-
Keeping the above points in mind -