There are a total of A + B cats and dogs. Among them, A are known to be cats, but the…
- User
There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.
Determine if it is possible that there are exactly X cats among these A + B animals.
Constraints
- 1 \leq A \leq 100
- 1 \leq B \leq 100
- 1 \leq X \leq 200
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
A B X
Output
If it is possible that there are exactly X cats, print
YES; if it is impossible, printNO.Examples
Input
3 5 4
Output
YES
Input
2 2 6
Output
NO
Input
5 3 2
Output
NO
Assistant
python# Read input values A, B, X = map(int, input().split()) # Calculate the minimum and maximum possible number of cats min_cats = A max_cats = A + B # Check if X is within the possible range if min_cats <= X <= max_cats: print("YES") else: print("NO")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.