304751: CF907A. Masha and Bears

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

Description

Masha and Bears

题意翻译

有三头熊和一个人,他们有三辆车 公熊能够驾驶大车,他也喜欢大车。 母熊能够驾驶中车,她也喜欢中车。 小熊能够驾驶小车,他也喜欢小车。 那个人可以驾驶所有的车,但是他只喜欢小车。 给定三头熊和人的身高,保证公熊身高大于母熊身高大于小熊身高。 定义一个人(熊)能够驾驶一辆车当且仅当他的身高不大于车的大小。 定义一个人(熊)喜欢一辆车当且仅当他的身高的两倍不小于车的大小。 设计3辆车的大小,要求满足车的大小是非负数,满足题设给出的条件,如果有多组解输出任意一组,无解输出-1−1 Translated by 东吴四杰

题目描述

A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes it. Moreover, son bear can climb into the smallest car and he likes it. It's known that the largest car is strictly larger than the middle car, and the middle car is strictly larger than the smallest car. Masha came to test these cars. She could climb into all cars, but she liked only the smallest car. It's known that a character with size $ a $ can climb into some car with size $ b $ if and only if $ a<=b $ , he or she likes it if and only if he can climb into this car and $ 2a>=b $ . You are given sizes of bears and Masha. Find out some possible integer non-negative sizes of cars.

输入输出格式

输入格式


You are given four integers $ V_{1} $ , $ V_{2} $ , $ V_{3} $ , $ V_{m} $ ( $ 1<=V_{i}<=100 $ ) — sizes of father bear, mother bear, son bear and Masha, respectively. It's guaranteed that $ V_{1}>V_{2}>V_{3} $ .

输出格式


Output three integers — sizes of father bear's car, mother bear's car and son bear's car, respectively. If there are multiple possible solutions, print any. If there is no solution, print "-1" (without quotes).

输入输出样例

输入样例 #1

50 30 10 10

输出样例 #1

50
30
10

输入样例 #2

100 50 10 21

输出样例 #2

-1

说明

In first test case all conditions for cars' sizes are satisfied. In second test case there is no answer, because Masha should be able to climb into smallest car (so size of smallest car in not less than 21), but son bear should like it, so maximum possible size of it is 20.

Input

题意翻译

有三头熊和一个人,他们有三辆车 公熊能够驾驶大车,他也喜欢大车。 母熊能够驾驶中车,她也喜欢中车。 小熊能够驾驶小车,他也喜欢小车。 那个人可以驾驶所有的车,但是他只喜欢小车。 给定三头熊和人的身高,保证公熊身高大于母熊身高大于小熊身高。 定义一个人(熊)能够驾驶一辆车当且仅当他的身高不大于车的大小。 定义一个人(熊)喜欢一辆车当且仅当他的身高的两倍不小于车的大小。 设计3辆车的大小,要求满足车的大小是非负数,满足题设给出的条件,如果有多组解输出任意一组,无解输出-1−1 Translated by 东吴四杰

加入题单

算法标签: