407377: GYM102780 A Green tea
Description
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.
InputThe 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$$$).
OutputThe 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$$$.
ExamplesInput100 20Output
3 1Input
100 30Output
5 2