問題一覧 > 通常問題

No.236 Yuenyeung Tea

レベル : / AI推定難易度 : 118 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 256 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-6}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 497
作問者 : evima
お気に入りにしたユーザー ProblemId : 592 / 自分の提出
問題文最終更新日: 2026-06-26 06:00:31
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 113 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。