問題一覧 > 通常問題

No.2850 Make Slimes

レベル : / AI推定難易度 : 124 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 157
作問者 : dyktr_06 / テスター : ryota2357 hikikomori square1001 sepa38
お気に入りにしたユーザー ProblemId : 10855 / 自分の提出
問題文最終更新日: 2024-08-20 19:22:05
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 442 MMA Contest 019 (順位表) の他の問題:

Problem Statement

Yakitori-kun is trying to make slimes.

To make $1$ slime, $A$ ml of laundry starch and $B$ g of borax are required.

Yakitori-kun has $C$ ml of laundry starch and $D$ g of borax.

Find the maximum number of slimes Yakitori-kun can make.


Constraints

  • $0 \leq A, B, C, D \leq 1000$
  • $1 \leq A + B$
  • All input values are integers.

Input

The input is given from standard input in the following format.

$A$ $B$ $C$ $D$ 

Output

Output the answer to the problem on one line.

Sample

Sample 1
Input
100 5 250 25
Output
2

After making the $1$st slime, the remaining laundry starch and borax are $150$ ml and $20$ g, respectively.

After making the $2$nd slime, the remaining laundry starch and borax are $50$ ml and $15$ g, respectively.

The $3$rd slime cannot be made because there is not enough laundry starch.

Therefore, the maximum number of slimes Yakitori-kun can make is $2$, so output $2$.

Sample 2
Input
0 1 0 38
Output
38

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。