408123: GYM102992 K K Co-prime Permutation

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

K. K Co-prime Permutationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Kotori is very good at math (really?) and she loves playing with permutations and primes.

One day, she thinks of a special kind of permutation named $$$k$$$ co-prime permutation. A permutation $$$p_1,p_2,\cdots,p_n$$$ of $$$n$$$ is called a $$$k$$$ co-prime permutation of $$$n$$$ if there exists exactly $$$k$$$ integers $$$i$$$ such that $$$1 \le i \le n$$$ and $$$\text{gcd}(p_i,i)=1$$$, where $$$\text{gcd}(x,y)$$$ indicates the greatest common divisor of $$$x$$$ and $$$y$$$.

Given $$$n$$$ and $$$k$$$, please help Kotori construct a $$$k$$$ co-prime permutation of $$$n$$$ or just report that there is no such permutation.

Recall that a permutation of $$$n$$$ is a sequence of length $$$n$$$ containing all integers from $$$1$$$ to $$$n$$$.

Input

There is only one test case in each test file.

The first and only line contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10^6$$$, $$$0 \le k \le n$$$).

Output

Output one line containing $$$n$$$ integers $$$p_1, p_2, \cdots, p_n$$$ separated by one space, indicating the permutation satisfying the given constraints. If no such permutation exists output "-1" (without quotes) instead. If there are multiple valid answers you can print any of them.

Please, DO NOT output extra spaces at the end of each line, otherwise your answer may be considered incorrect!

ExamplesInput
5 3
Output
1 4 5 2 3
Input
1 0
Output
-1

加入题单

算法标签: