CF148C.Terse princess
普及+/提高
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
«Next please», — the princess called and cast an estimating glance at the next groom.
The princess intends to choose the most worthy groom, this is, the richest one. Whenever she sees a groom who is more rich than each of the previous ones, she says a measured «Oh...». Whenever the groom is richer than all previous ones added together, she exclaims «Wow!» (no «Oh...» in this case). At the sight of the first groom the princess stays calm and says nothing.
The fortune of each groom is described with an integer between 1 and 50000. You know that during the day the princess saw n grooms, said «Oh...» exactly a times and exclaimed «Wow!» exactly b times. Your task is to output a sequence of n integers _t_1, _t_2, ..., t__n, where t__i describes the fortune of i-th groom. If several sequences are possible, output any of them. If no sequence exists that would satisfy all the requirements, output a single number -1.
“下一位,请!”,公主呼唤道,并略带审视地打量着下一位求婚者。
公主打算选择最值得托付终身的求婚者,也就是最富有的那一位。每当她看到一位比之前所有求婚者都更富有的求婚者时,她便会从容地说一声“哦……”。而当某位求婚者的财富超过之前所有求婚者财富的总和时,她则会惊呼一声“哇!”(此时不再说“哦……”)。面对第一位求婚者,公主保持镇定,一言不发。
每位求婚者的财富用一个介于 1 到 50000 之间的整数表示。已知在当天,公主共见了 n 位求婚者,说了恰好 a 次“哦……”,并惊呼了恰好 b 次“哇!”。你的任务是输出一个由 n 个整数组成的序列 t1,t2,...,tn,其中 ti 表示第 i 位求婚者的财富。若存在多个满足条件的序列,输出任意一个即可;若不存在满足所有要求的序列,则仅输出一个数字 −1。
输入格式
The only line of input data contains three integer numbers n, a and b (1 ≤ n ≤ 100, 0 ≤ a, b ≤ 15, n > a + b), separated with single spaces.
输入数据仅有一行,包含三个整数 n、a 和 b(满足 1≤n≤100,0≤a,b≤15,且 n>a+b),它们之间用单个空格分隔。
输出格式
Output any sequence of integers _t_1, _t_2, ..., t__n, where t__i (1 ≤ t__i ≤ 50000) is the fortune of i-th groom, that satisfies the given constraints. If no sequence exists that would satisfy all the requirements, output a single number -1.
输出任意一个整数序列 t1,t2,...,tn,其中每个 ti(1≤ti≤50000)表示第 i 位新郎的财富值,且该序列满足所有给定约束条件。若不存在满足全部要求的序列,则仅输出一个数字 −1。
输入输出样例
输入#1
10 2 3
输出#1
5 1 3 6 16 35 46 4 200 99
输入#2
5 0 0
输出#2
10 10 6 6 5
说明/提示
Let's have a closer look at the answer for the first sample test.
- The princess said «Oh...» (highlighted in bold): 5 1 3 6 16 35 46 4 200 99.
- The princess exclaimed «Wow!» (highlighted in bold): 5 1 3 6 16 35 46 4 200 99.
让我们更仔细地看一下第一个样例测试的答案。
- 公主说:“哦……”(以粗体标出):5 1 3 6 16 35 46 4 200 99。
- 公主惊呼:“哇!”(以粗体标出):5 1 3 6 16 35 46 4 200 99。
输入解题思路,AI测评打分。不知道怎么写?