#123. 数字范围模式判定
数字范围模式判定
Number Range Check
Background
Congcong is learning how to determine if a number falls within a specific range based on different conditions.
Problem Description
Given an integer and a boolean value .
If is false, return true if is in the range to , inclusive.
If is true, return true if is less than or equal to , or greater than or equal to .
Otherwise, return false.
Input Format
Input is given from standard input in the following format.
Where is an integer and is a boolean value (true or false).
Output Format
Output is printed to standard output in the following format.
trueorfalse
Sample
5 false
true
11 false
false
11 true
true
Sample Explanation
Sample 1:
, . Since is false, we check if is between and . is within this range, so true is returned.
Sample 2:
, . Since is false, we check if is between and . is not within this range, so false is returned.
Sample 3:
, . Since is true, we check if is less than or equal to or greater than or equal to . is greater than or equal to , so true is returned.
Constraints
For all test cases: is an integer. is a boolean value.