AtCoder Regular Contest 145
D
Non Arithmetic Progression Set
AtCoder
⌀ 2297
原题
← CE →
翻译中…

Problem Statement

翻译中…

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

翻译中…
  • $S$ has exactly $N$ elements.
  • The element of $S$ are distinct integers between $-10^7$ and $10^7$ (inclusive).
  • $\displaystyle \sum _{s \in S} s = M$.
  • $y-x\neq z-y$ for every triple $x,y,z$ $(x < y < z)$ of distinct elements in $S$.
翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 10^4$
  • $|M| \leq N\times 10^6$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N M

翻译中…

Output

翻译中…

Let $s_1,s_2,\ldots,s_N$ be the elements of $S$. Print a set $S$ that satisfies the conditions in the following format:

翻译中…

s_1 s_2 \ldots s_N

翻译中…

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

翻译中…

样例

Input #1
3 9
Output #1
1 2 6
We have $2-1 \neq 6-2$ and $1+2+6=9$, so this output satisfies the conditions. Many other solutions exist.
Input #2
5 -15
Output #2
-15 -5 0 2 3
$M$ may be negative.
题目信息
题号
arc145_d
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。