CF126A.Hot Bath

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Bob is about to take a hot bath.

There are two taps to fill the bath: a hot water tap and a cold water tap. The cold water's temperature is t1t_{1} , and the hot water's temperature is t2t_{2} . The cold water tap can transmit any integer number of water units per second from 00 to x1x_{1} , inclusive. Similarly, the hot water tap can transmit from 00 to x2x_{2} water units per second.

If y1y_{1} water units per second flow through the first tap and y2y_{2} water units per second flow through the second tap, then the resulting bath water temperature will be:

Bob wants to open both taps so that the bath water temperature was not less than t0t_{0} . However, the temperature should be as close as possible to this value. If there are several optimal variants, Bob chooses the one that lets fill the bath in the quickest way possible.

Determine how much each tap should be opened so that Bob was pleased with the result in the end.

输入格式

You are given five integers t1t_{1} , t2t_{2} , x1x_{1} , x2x_{2} and t0t_{0} ( 1<=t1<=t0<=t2<=1061<=t_{1}<=t_{0}<=t_{2}<=10^{6} , 1<=x1,x2<=1061<=x_{1},x_{2}<=10^{6} ).

输出格式

Print two space-separated integers y1y_{1} and y2y_{2} ( 0<=y1<=x10<=y_{1}<=x_{1} , 0<=y2<=x20<=y_{2}<=x_{2} ).

输入输出样例

  • 输入#1

    10 70 100 100 25
    

    输出#1

    99 33
  • 输入#2

    300 500 1000 1000 300
    

    输出#2

    1000 0
  • 输入#3

    143 456 110 117 273
    

    输出#3

    76 54

说明/提示

In the second sample the hot water tap shouldn't be opened, but the cold water tap should be opened at full capacity in order to fill the bath in the quickest way possible.

首页