407377: GYM102780 A Green tea

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

Description

A. Green teatime limit per test0.25 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

Programmer Basil likes to drink green tea. For brewing the green tea properly, one can't use hot water — it is recommended to use water with a temperature of exactly 80 degrees. In the room, where Basil works there is a boiler that maintains a constant water temperature of $$$t_1$$$ degrees, and a jug of cold water with a temperature of $$$t_2$$$ degrees. Basil has a mug, in which he makes tea, and a measuring spoon.

Help Basil — write a program that will determine by the temperature $$$t_1$$$ and $$$t_2$$$ how many spoons of water ($$$v_1$$$ and $$$v_2$$$) of each kind should be poured into a mug to get water with a temperature of exactly 80 degrees. If there are several solutions, type the one that has the minimal sum $$$v_1 + v_2$$$.

For simplicity, we assume that during the transfusion, the water temperature remains unchanged, and when the mixing happens, the law comes into force: $$$$$$t_1 \cdot v_1 + t_2 \cdot v_2 = t_3 \cdot(v_1 + v_2),$$$$$$ where $$$t_1$$$ and $$$t_2$$$ are the temperatures of the portions of water being mixed, $$$v_1$$$ and $$$v_2$$$ are the volumes of these portions, and $$$t_3$$$ is the temperature obtained as a result of mixing.

Input

The program receives 2 integers at the input, separated by a space: temperatures $$$t_1$$$ ($$$80 \leq t_1 \leq 100$$$) and $$$t_2$$$ ($$$0 \leq t_2 < 80$$$).

Output

The program is supposed to output two integers — volumes $$$v_1$$$ and $$$v_2$$$ ($$$0 \leq v_1, v_2 \leq 1000$$$), where $$$v_1$$$ is the number of spoons of water with the temperature $$$t_1$$$, $$$v_2$$$ is the number of spoons of water with the temperature $$$t_2$$$.

ExamplesInput
100 20
Output
3 1
Input
100 30
Output
5 2

加入题单

算法标签: