No.236 Yuenyeung Tea
タグ : / 解いたユーザー数 497
作問者 :
evima
Problem Statement
You make yuenyeung tea by mixing coffee and black tea in the ratio $A : B$.
Given $X$ milliliters of coffee and $Y$ milliliters of black tea,
what is the maximum amount of yuenyeung tea, in milliliters, that you can make?
(Added 2015/07/06 23:27)
Note: Be careful, as some output functions may have issues with the number of significant digits.
Input
$A$ $B$ $X$ $Y$
- $1 \le A, B, X, Y \le 1000$
- All input values are integers.
Output
Output the maximum amount of yuenyeung tea that can be made, followed by a newline.
Your answer is considered correct if its absolute or relative error from the judge's output is at most $10^{-6}$.
Sample
Sample 1
Input
1 1 150 200
Output
300
You can make $300$ milliliters of yuenyeung tea from $150$ milliliters of coffee and $150$ milliliters of black tea.
Sample 2
Input
4 6 150 200
Output
333.333333333333
You can make $1000/3$ milliliters of yuenyeung tea from $400/3$ milliliters of coffee and $200$ milliliters of black tea.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。