CF907A.Masha and Bears

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 aa can climb into some car with size bb if and only if a<=ba<=b , he or she likes it if and only if he can climb into this car and 2a>=b2a>=b .

You are given sizes of bears and Masha. Find out some possible integer non-negative sizes of cars.

输入格式

You are given four integers V1V_{1} , V2V_{2} , V3V_{3} , VmV_{m} ( 1<=Vi<=1001<=V_{i}<=100 ) — sizes of father bear, mother bear, son bear and Masha, respectively. It's guaranteed that V1>V2>V3V_{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.

首页