After passing hero test 1 with flying colours, now Ninja gets a different exam to get promoted to the hero class S.
Here also the pattern is the same as the previous exam, Ninja will get ‘N’ questions from 1 to ‘N’ but this time Ninja comes with a new technique to order the questions, he will solve a question after skipping ‘K’ questions (assume that after ‘N’th question he will come back to the first question) until he completes all questions.
Help Ninja by telling him the order of questions that is always a permutation of 1 to ‘N’.
For example:If the number of questions is ‘5’ and ‘K’ = 3
Then the order will be
“4 3 5 2 1”
The first line of input contains an integer 'T' representing the number of test cases.
The first line of each test case contains two space-separated integers, ‘N’ and ‘K’, denoting the number of questions and number of questions that he wants to skip.
Output Format :
For each test case, return the order of the questions separated by space.
The output of each test case will be printed in a separate line.
1 <= T <= 5
1 <= N, K <= 3000
Where ‘T’ is the number of test cases, ‘N’ is the number of questions, and ‘K’ is the number of questions that Ninja will skip after solving one question.
Time limit: 1 second.
Note:
You do not need to print anything. It has already been taken care of. Just implement the given function.
2
6 3
4 1
4 2 1 3 6 5
2 4 3 1
Test Case 1: There are 6 questions,the and ninja will start solving the questions as shown in image below: 4 2 1 3 6 5

Test Case 2: There are 4 questions, and ninja will start solving the questions as shown in the image below: 2, 4, 3, 1

2
5 4
1 10
5 1 3 4 2
1
Delete the element present at the Kth position.
The idea here is to remove the Kth element from the array. We need two operations to achieve this task, i.e. find the Kth element and delete that element, here we will do this by storing all numbers 1 to N in an array and then remove the Kth element.
Algorithm:
O(N ^ 2), where ‘N’ is the initial number of the questions given.
In the worst case, on removing each element, we need to make the whole array shift that will take O(N). Hence, the overall time complexity is O(N ^ 2).
O(N), where ‘N’ is the initial number of questions given.
Storing of 1 to ‘N’ numbers will take O(N). Hence, the overall space complexity is O(N).