Given two integers n and k, find the kth permutation sequence of numbers from 1 to n.
The numbers from 1 to n has n! unique permutations.
For n=3, the permutations in order are:
“123”“132”“213”“231”“312”“321”The 4th permutation is “231”.
The first line contains an integer ‘T’, denoting the number of test cases.
For each test case, a line containing space-separated integers ‘n’ and ‘k’.
For each test case, print the kth permutation in a separate line.
2
4 3
3 4
1324
231
1 <= T <= 100
1 <= n <= 9
1 <= k <= n!