No.3511 Skg
タグ : / 解いたユーザー数 96
作問者 :
Germanium32
yt142857
Problem Statement
Seiko Gakuin has $A$ chairs and $B$ desks.
The weight per $1$ chair is $C\ \mathrm{kg}$, and the weight per $1$ desk is $D\ \mathrm{kg}$.
Sei-kun is confident in his arm strength, so he can hold anything as long as the total weight is at most $S\ \mathrm{kg}$.
Determine whether Sei-kun can hold all the desks and chairs at Seiko Gakuin at the same time.
Constraints
・$1 \le A \le 100$・$1 \le B \le 100$
・$1 \le C \le 100$
・$1 \le D \le 100$
・$1 \le S \le 20000$
・All input values are integers.
Input
The input is given from standard input in the following format.
$A\ \ B\ \ C\ \ D\ \ S$
Output
Print Yes if Sei-kun can hold all the desks and chairs at the same time, and No otherwise.
Print a newline at the end.
Sample
Sample 1
Input
1 2 3 4 12
Output
Yes
The total weight of the chairs is $1 \times 3 = 3(\mathrm{kg})$.
The total weight of the desks is $2 \times 4 = 8(\mathrm{kg})$.
Sei-kun can hold up to $12\mathrm{kg}$, so since $3 + 8 \le 12$, he can hold all the desks and chairs at the same time.
Therefore, the answer is
Yes.
Sample 2
Input
1 1 1 1 1
Output
No
Since $1 \times 1 + 1 \times 1 > 1$, Sei-kun cannot hold all the desks and chairs at the same time. Therefore, print No.
Sample 3
Input
100 100 100 100 20000
Output
Yes
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。