AtCoder Beginner Contest 094
翻译中…
Problem Statement
翻译中…
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, print NO.
翻译中…
样例
Input #1
3 5 4
Output #1
YES
If there are one cat and four dogs among the $B = 5$ animals, there are $X = 4$ cats in total.
Input #2
2 2 6
Output #2
NO
Even if all of the $B = 2$ animals are cats, there are less than $X = 6$ cats in total.
Input #3
5 3 2
Output #3
NO
Even if all of the $B = 3$ animals are dogs, there are more than $X = 2$ cats in total.
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。