「CF415C」Mashmokh and Numbers

2014年4月7日3,3290

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.

Input

The first line of input contains two space-separated integers n, k (1 ≤ n ≤ 105; 0 ≤ k ≤ 108).

Output

If such sequence doesn’t exist output -1 otherwise output n distinct space-separated integers a1, a2, …, an (1 ≤ ai ≤ 109).

Sample test(s)
input

output

input

output

input

output

Note

gcd(x, y) is greatest common divisor of x and y.

题解

这题可以让前两个的gcd=k-n/2+1

然后后面全部互质就行了,注意n=1的情况

我搞了个素数表。。

avatar
  Subscribe  
提醒