Two days before the contest, Keenan proposed the following lovely problem as the third problem of the DMOPC:
Given a permutation
of the first positive integers, a valley is a triplet of indices such that . Count the number of valleys.
Unfortunately, it has neither flavourtext nor data. Now that Edward has finished with the flavourtext, it is your job to generate the data. Specifically, Keenan wants a case with a permutation of length
Constraints
Subtask 1 [20%]
Subtask 2 [40%]
Subtask 3 [40%]
No additional constraints.
Input Specification
The first and only line of input contains
Output Specification
On a single line, output the lexicographically smallest permutation of the first -1
if none exist.
Scoring
You will receive 50% of the marks for a case if your permutation of length
Sample Input 1
5 4
Sample Output 1
2 1 4 3 5
Explanation for Sample 1
The valleys are
Sample Input 2
4 100
Sample Output 2
-1
Sample Input 3
10 20
Sample Output 3
1 2 3 7 9 5 4 6 8 10
Comments