301233: CF231B. Magic, Wizardry and Wonders

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Magic, Wizardry and Wonders

题意翻译

瓦西亚,伟大的魔术师和魔术师,喜欢各种奇迹和魔法。只要一根魔杖,他就能把一个物体变成别的东西。但是,你们都知道,在宇宙中没有比数字的魔力更神奇的了。这就是为什么Vasya热爱数学,花很多时间把一些数字转换成另一些数字的原因。 今天早上他有n张卡片,上面摆着整数。每个整数不小于1,但不大于l l。当瓦西亚挥舞他的魔杖时,两张最右边的牌从队伍中消失了,一张新的牌神奇地出现在他们的位置上。它包含了两张消失的卡片上的左号码和右号码之间的差别。瓦西亚很想知道接下来会发生什么,于是他挥舞着魔杖,直到桌子上只剩下一张牌为止。 假设Vasya最初有以下卡片:4、1、1、3(从左到右列出)。然后,在第一波之后,这条线将是:4,1,-2,在第二条之后:4,3,在第三条之后,表中将有一张带有数字1的卡片。 请注意,尽管最初卡片上的所有数字都不小于1且不大于l l,但出现卡片上的数字可以是任何数字,但不会对它们施加任何限制。 现在是傍晚。瓦西亚很累了,他想把所有的东西都退回来,但是不记得早上他拿到了哪张牌。他只记得有n张卡片,它们包含1到l l之间的整数,而在所有的魔法动作之后,他只剩下一张包含d d的卡片。 帮助Vasya恢复最初的一组带有数字的卡片。

题目描述

Vasya the Great Magician and Conjurer loves all kinds of miracles and wizardry. In one wave of a magic wand he can turn an object into something else. But, as you all know, there is no better magic in the Universe than the magic of numbers. That's why Vasya adores math and spends a lot of time turning some numbers into some other ones. This morning he has $ n $ cards with integers lined up in front of him. Each integer is not less than 1, but not greater than $ l $ . When Vasya waves his magic wand, two rightmost cards vanish from the line and a new card magically appears in their place. It contains the difference between the left and the right numbers on the two vanished cards. Vasya was very interested to know what would happen next, and so he waved with his magic wand on and on, until the table had a single card left. Suppose that Vasya originally had the following cards: 4, 1, 1, 3 (listed from left to right). Then after the first wave the line would be: 4, 1, -2, and after the second one: 4, 3, and after the third one the table would have a single card with number 1. Please note that in spite of the fact that initially all the numbers on the cards were not less than 1 and not greater than $ l $ , the numbers on the appearing cards can be anything, no restrictions are imposed on them. It is now evening. Vasya is very tired and wants to return everything back, but does not remember which cards he had in the morning. He only remembers that there were $ n $ cards, they contained integers from 1 to $ l $ , and after all magical actions he was left with a single card containing number $ d $ . Help Vasya to recover the initial set of cards with numbers.

输入输出格式

输入格式


The single line contains three space-separated integers: $ n $ ( $ 2<=n<=100 $ ) — the initial number of cards on the table, $ d $ ( $ |d|<=10^{4} $ ) — the number on the card that was left on the table after all the magical actions, and $ l $ ( $ 1<=l<=100 $ ) — the limits for the initial integers.

输出格式


If Vasya is mistaken, that is, if there doesn't exist a set that meets the requirements given in the statement, then print a single number -1, otherwise print the sought set containing $ n $ integers from $ 1 $ to $ l $ . Separate the integers by spaces. Print the integers in the order, in which they were written on the cards from left to right. If there are several suitable sets of numbers, you can print any of them.

输入输出样例

输入样例 #1

3 3 2

输出样例 #1

2 1 2 

输入样例 #2

5 -4 3

输出样例 #2

-1

输入样例 #3

5 -4 4

输出样例 #3

2 4 1 4 1 

Input

题意翻译

瓦西亚,伟大的魔术师和魔术师,喜欢各种奇迹和魔法。只要一根魔杖,他就能把一个物体变成别的东西。但是,你们都知道,在宇宙中没有比数字的魔力更神奇的了。这就是为什么Vasya热爱数学,花很多时间把一些数字转换成另一些数字的原因。 今天早上他有n张卡片,上面摆着整数。每个整数不小于1,但不大于l l。当瓦西亚挥舞他的魔杖时,两张最右边的牌从队伍中消失了,一张新的牌神奇地出现在他们的位置上。它包含了两张消失的卡片上的左号码和右号码之间的差别。瓦西亚很想知道接下来会发生什么,于是他挥舞着魔杖,直到桌子上只剩下一张牌为止。 假设Vasya最初有以下卡片:4、1、1、3(从左到右列出)。然后,在第一波之后,这条线将是:4,1,-2,在第二条之后:4,3,在第三条之后,表中将有一张带有数字1的卡片。 请注意,尽管最初卡片上的所有数字都不小于1且不大于l l,但出现卡片上的数字可以是任何数字,但不会对它们施加任何限制。 现在是傍晚。瓦西亚很累了,他想把所有的东西都退回来,但是不记得早上他拿到了哪张牌。他只记得有n张卡片,它们包含1到l l之间的整数,而在所有的魔法动作之后,他只剩下一张包含d d的卡片。 帮助Vasya恢复最初的一组带有数字的卡片。

加入题单

算法标签: