CF BUDDY
← Problems·

1305E · Kuroni and the Score Distribution

2200 · constructive algorithms, greedy, implementation

Problem: 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 nn problems, numbered from 11 to nn. 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 a1,a2,,ana_1, a_2, \dots, a_n, where aia_i is the score of ii-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 10910^9.
  • A harder problem should grant a strictly higher score than an easier problem. In other words, 1a1<a2<<an1091 \leq a_1 < a_2 < \dots < a_n \leq 10^9.
  • The balance of the score distribution, defined as the number of triples (i,j,k)(i, j, k) such that 1i<j<kn1 \leq i < j < k \leq n and ai+aj=aka_i + a_j = a_k, should be exactly mm.

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

Input Format: The first and single line contains two integers nn and mm (1n50001 \le n \le 5000, 0m1090 \leq m \leq 10^9) — the number of problems and the required balance.

Output Format: If there is no solution, print a single integer 1-1.

Otherwise, print a line containing nn integers a1,a2,,ana_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 33 triples (i,j,k)(i, j, k) that contribute to the balance of the score distribution.

  • (1,2,3)(1, 2, 3)
  • (1,3,4)(1, 3, 4)
  • (2,4,5)(2, 4, 5)

Sample Cases

Case 1

Input

5 3

Output

4 5 9 13 18

Case 2

Input

8 0

Output

10 11 12 13 14 15 16 17

Case 3

Input

4 10

Output

-1

Similar problems

00:00:00
Loading editor…
Welcome! I'm your coding tutor for this problem. Use the chips below to reveal stored hints or get AI feedback on your code. I'll guide you step by step — never giving away the solution.

Sign in to unlock AI tutor feedback