Ozon Tech Challenge 2020 (Div.1 + Div.2, Rated, T-shirts + prizes!)
E
Kuroni and the Score Distribution
Codeforces
2200
原题
← DF →
翻译中…

Kuroni is the coordinator of the next Mathforces round written by the "Proof by AC" team. All the preparation has been done, and he is discussing with the team about the score distribution for the round.

翻译中…

The round consists of $n$ problems, numbered from $1$ to $n$. The problems are ordered in increasing order of difficulty, no two problems have the same difficulty. A score distribution for the round can be denoted by an array $a_1, a_2, \dots, a_n$, where $a_i$ is the score of $i$-th problem.

翻译中…

Kuroni thinks that the score distribution should satisfy the following requirements:

翻译中…
  • The score of each problem should be a positive integer not exceeding $10^9$.
  • A harder problem should grant a strictly higher score than an easier problem. In other words, $1 \leq a_1 \lt a_2 \lt \dots \lt a_n \leq 10^9$.
  • The balance of the score distribution, defined as the number of triples $(i, j, k)$ such that $1 \leq i \lt j \lt k \leq n$ and $a_i + a_j = a_k$, should be exactly $m$.
翻译中…

Help the team find a score distribution that satisfies Kuroni's requirement. In case such a score distribution does not exist, output $-1$.

翻译中…

Input

翻译中…

The first and single line contains two integers $n$ and $m$ ($1 \le n \le 5000$, $0 \leq m \leq 10^9$) — the number of problems and the required balance.

翻译中…

Output

翻译中…

If there is no solution, print a single integer $-1$.

翻译中…

Otherwise, print a line containing $n$ integers $a_1, a_2, \dots, a_n$, representing a score distribution that satisfies all the requirements. If there are multiple answers, print any of them.

翻译中…

Note

翻译中…

In the first example, there are $3$ triples $(i, j, k)$ that contribute to the balance of the score distribution.

翻译中…
  • $(1, 2, 3)$
  • $(1, 3, 4)$
  • $(2, 4, 5)$
翻译中…

样例

Input #1
5 3
Output #1
4 5 9 13 18
InputCopy OutputCopy
Input #2
8 0
Output #2
10 11 12 13 14 15 16 17
InputCopy OutputCopy
Input #3
4 10
Output #3
-1
InputCopy OutputCopy
题目信息
题号
1305E
时间限制
1 s
内存限制
256 MB
标签
构造
贪心
模拟
数学

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