No.2850 Make Slimes
タグ : / 解いたユーザー数 157
作問者 :
hikikomori
sepa38
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もしくは右上の雲マークをクリックしてアカウントを作成してください。