#118. 松鼠玩耍判断
松鼠玩耍判断
Squirrel Play Judgment
Background
In beautiful Palo Alto, a group of lively squirrels are full of energy every day. They spend most of their time playing, but whether they play depends on the day's temperature and season.
Problem Description
The squirrels in Palo Alto spend most of the day playing. In particular, they play if the temperature is between and (inclusive). Unless it is summer, then the upper limit is instead of .
Given an integer temperature and a boolean isSummer, return true if the squirrels play and false otherwise.
Input Format
Input is given from standard input in the following format.
temperatureisSummer
Where temperature is an integer and isSummer is a boolean (true or false).
Output Format
Output is printed to standard output in the following format.
A boolean value (
trueorfalse), indicating whether the squirrels play.
Sample
70 false
true
95 false
false
95 true
true
Sample Explanation
Sample 1:
Temperature is , and it's not summer. is between and , so squirrels play, returning true.
Sample 2:
Temperature is , and it's not summer. is not between and , so squirrels do not play, returning false.
Sample 3:
Temperature is , and it's summer. In summer, the upper limit is . is between and , so squirrels play, returning true.
Constraints
Time limit: second, Memory limit: KiB for each test case.