#P9632. [ICPC 2020 Nanjing R] K Co-prime Permutation

[ICPC 2020 Nanjing R] K Co-prime Permutation

题目描述

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\textit{k co-prime permutation}. A permutation p1,p2,,pnp_1,p_2,\cdots,p_n of nn is called a kk co-prime permutation of nn if there exists exactly kk integers ii such that 1in1 \le i \le n and gcd(pi,i)=1\text{gcd}(p_i,i)=1, where gcd(x,y)\text{gcd}(x,y) indicates the greatest common divisor of xx and yy.

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

Recall that a permutation of nn is a sequence of length nn containing all integers from 11 to nn.

输入格式

There is only one test case in each test file.

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

输出格式

Output one line containing nn integers p1,p2,,pnp_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!

5 3
1 4 5 2 3
1 0
-1