Kanade has an array a[1..n] , she define that an array b[1..m] is good if and only if it satisfy the following conditions:
-
1<=b[i]<=n
-
b[i]<b[i+1] for every i between 1 and m-1
-
a[b[i]] < a[b[i+1]] for every i between 1 and m-1
-
m>0
Now you need to find the k-th smallest lexicographically good array.
