atcoder#ARC145D. [ARC145D] Non Arithmetic Progression Set

[ARC145D] Non Arithmetic Progression Set

Score : 700700 points

Problem Statement

Construct a set SS of integers satisfying all of the conditions below. It can be proved that at least one such set SS exists under the Constraints of this problem.

  • SS has exactly NN elements.
  • The element of SS are distinct integers between 107-10^7 and 10710^7 (inclusive).
  • sSs=M\displaystyle \sum _{s \in S} s = M.
  • yxzyy-x\neq z-y for every triple x,y,zx,y,z (x<y<z)(x < y < z) of distinct elements in SS.

Constraints

  • 1N1041 \leq N \leq 10^4
  • MN×106|M| \leq N\times 10^6
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN MM

Output

Let s1,s2,,sNs_1,s_2,\ldots,s_N be the elements of SS. Print a set SS that satisfies the conditions in the following format:

s1s_1 s2s_2 \ldots sNs_N

If multiple solutions exist, any of them will be accepted.

3 9
1 2 6

We have 21622-1 \neq 6-2 and 1+2+6=91+2+6=9, so this output satisfies the conditions. Many other solutions exist.

5 -15
-15 -5 0 2 3

MM may be negative.