sort elements in a[i-m+1 .. i] in non-decreasing order. Now you are given n, m, k and the return array ret[0 .. n-1] of this function.Please find the array b[0 .. n-1] which is the k-th lexicographically smallest array of length n that satisfies f = ret[0 .. n-1].The input will be given such that there are at least k different arrays of length n that function f returnsret[0 .. n-1] when being the input array.
The pseudocode of function f is as follows: function f(int n, array a[], int m): for i from m - 1 to n - 1: sort elements in a[i-m+1 .. i] in non-decreasing order return array a[0 .. n-1] Now you are given n, m, k and the return array ret[0 .. n-1] of this function. Please find the array b[0 .. n-1] which is the k-th lexicographically smallest array of length n that satisfies f(n, b, m) = ret[0 .. n-1]. The input will be given such that there are at least k different arrays of length n that function f returns ret[0 .. n-1] when being the input array.