CF414A.Mashmokh and Numbers
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
It's holiday. Mashmokh and his boss, Bimokh, are playing a game invented by Mashmokh.
In this game Mashmokh writes sequence of n distinct integers on the board. Then Bimokh makes several (possibly zero) moves. On the first move he removes the first and the second integer from from the board, on the second move he removes the first and the second integer of the remaining sequence from the board, and so on. Bimokh stops when the board contains less than two numbers. When Bimokh removes numbers x and y from the board, he gets gcd(x,y) points. At the beginning of the game Bimokh has zero points.
Mashmokh wants to win in the game. For this reason he wants his boss to get exactly k points in total. But the guy doesn't know how choose the initial sequence in the right way.
Please, help him. Find n distinct integers a1,a2,...,an such that his boss will score exactly k points. Also Mashmokh can't memorize too huge numbers. Therefore each of these integers must be at most 109 .
输入格式
The first line of input contains two space-separated integers n,k (1<=n<=105; 0<=k<=108) .
输出格式
If such sequence doesn't exist output -1 otherwise output n distinct space-separated integers a1,a2,...,an (1<=ai<=109) .
输入输出样例
输入#1
5 2
输出#1
1 2 3 4 5
输入#2
5 3
输出#2
2 4 3 7 1
输入#3
7 2
输出#3
-1
说明/提示
gcd(x,y) is greatest common divisor of x and y .