No.804 Not a Fan of Vegetables
タグ : / 解いたユーザー数 631
作問者 :
sinsincoscos
/ テスター :
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もしくは右上の雲マークをクリックしてアカウントを作成してください。