Takahashi likes the sound when he buys a drink from a vending machine. That sound can be…
- User
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
Constraints
- All values in input are integers.
- 1 \leq A, B, C \leq 100
Input
Input is given from Standard Input in the following format:
A B C
Output
Print the number of times Takahashi will hear his favorite sound.
Examples
Input
2 11 4
Output
4
Input
3 9 5
Output
3
Input
100 1 10
Output
0
Assistant
We need to parse the problem. There's a vending machine sound that can be heard by spending A yen each time. Takahashi has B yen. He wants to hear the sound as many times as possible, but at most C times because he would be satisfied at that time. So we need to compute how many times he will actually hear the sound.
Essentially, the maximum possible number of times he can afford is floor(B / A) because each sound costs A yen. However, he also has a limit of C times: he will stop at C even if he could afford more. So the answer is min( floor(B/A), C ). But note that if B < A, floor(B/A) = 0.
Constraints: all integers between 1 and 100 inclusive.
So it's straightforward.
Given examples: Example 1: A=2, B=11, C=4 => floor(11/2)=5, min(5,4)=4 => output 4. Example 2: A=3, B=9, C=5 => floor(9/3)=3, min(3,5)=3 => output 3. Example 3: A=100, B=1, C=10 => floor(1/100)=0, min(0,10)=0 => output 0.
Thus answer is min(B // A, C).
We'll implement in Python.
Edge cases: Ensure integer division floor. B and A are positive.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.