CF1305E.Kuroni and the Score Distribution
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 a1,a2,…,an , where ai 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 109 .
- A harder problem should grant a strictly higher score than an easier problem. In other words, 1≤a1<a2<⋯<an≤109 .
- The balance of the score distribution, defined as the number of triples (i,j,k) such that 1≤i<j<k≤n and ai+aj=ak , 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 .
输入格式
The first and single line contains two integers n and m ( 1≤n≤5000 , 0≤m≤109 ) — the number of problems and the required balance.
输出格式
If there is no solution, print a single integer −1 .
Otherwise, print a line containing n integers a1,a2,…,an , representing a score distribution that satisfies all the requirements. If there are multiple answers, print any of them.
输入输出样例
输入#1
5 3
输出#1
4 5 9 13 18
输入#2
8 0
输出#2
10 11 12 13 14 15 16 17
输入#3
4 10
输出#3
-1
说明/提示
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)