#116. 雪茄数量与周末派对成功判断
雪茄数量与周末派对成功判断
Successful Party Check
Background
Small animals love to host parties.
Problem Description
When squirrels get together for a party, they like to have cigars. A squirrel party is successful when the number of cigars is between and , inclusive. Unless it is the weekend, in which case there is no upper bound on the number of cigars. Return true if the party with the given values is successful, or false otherwise.
Input Format
Input is given from standard input in the following format.
(number of cigars) (is it the weekend,
trueorfalse)
Output Format
Output is printed to standard output in the following format.
Output
trueif the party is successful; otherwise, outputfalse.
Sample
30 false
false
50 false
true
70 true
true
Sample Explanation
Sample 1: The number of cigars is not between and , and it's not the weekend, so the party is not successful. Sample 2: The number of cigars is between and , and it's not the weekend, so the party is successful. Sample 3: The number of cigars is not between and , but it is the weekend, so there is no upper bound, and the party is successful.
Constraints
is a non-negative integer. is a boolean value.