問題一覧 > 通常問題

No.804 Not a Fan of Vegetables

レベル : / AI推定難易度 : 130 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 631
作問者 : sinsincoscos / テスター : ningenMe
お気に入りにしたユーザー ProblemId : 2557 / 自分の提出
問題文最終更新日: 2019-03-21 15:29:28
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 209 (順位表) の他の問題:

Problem Statement

In front of idsigma, there are $A$ vegetables and $B$ pieces of meat. He is not fond of vegetables, but for the sake of his health, he is trying to eat at least a few vegetables today.
In order for idsigma to eat a certain number of vegetables, he must at the same time eat $C$ times that number of pieces of meat. However, idsigma can eat at most $D$ items in total, counting vegetables and meat together, today. What is the maximum number of vegetables idsigma can eat today?

Input

$A\ B\ C\ D$

$1\le A,B,C,D\le 100$

Output

Output one integer representing the maximum number of vegetables idsigma can eat. Print a newline at the end.

Sample

Sample 1
Input
3 8 4 12
Output
2

He can eat 2 vegetables and 8 pieces of meat.

Sample 2
Input
3 8 100 12
Output
0

He cannot eat vegetables without a lot of meat, so he has no choice but to give up on eating vegetables.

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