All of you are probably very familiar with the problem of finding the longest monotone subsequence. You probably think you know all about it. In order to convince us, solve the problem "opposite" to finding the longest monotone subsequence.
For given
Input
The first line of input contains the integers
Output
If the required sequence doesn't exist, output -1
in the first and only line.
If the required sequence exists, output the required sequence of
The required sequence (if it exists) is not necessarily unique, so you can output any valid sequence.
Sample Input 1
4 3
Sample Output 1
1 4 2 3
Explanation for Sample Output 1
A sequence of length
Sample Input 2
5 1
Sample Output 2
-1
Sample Input 3
5 5
Sample Output 3
1 2 3 4 5
Comments