102280: [AtCoder]ABC228 A - On and Off
Description
Score : $100$ points
Problem Statement
Takahashi turns on the light of his room at $S$ o'clock (on the $24$-hour clock) every day and turns it off at $T$ o'clock every day.
The date may change while the light is on.
Determine whether the light is on at $30$ minutes past $X$ o'clock.
Constraints
- $0 \leq S, T, X \leq 23$
- $S \neq T$
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
$S$ $T$ $X$
Output
If the light is on at $30$ minutes past $X$ o'clock, print Yes
; otherwise, print No
.
Sample Input 1
7 20 12
Sample Output 1
Yes
The light is on between $7$ o'clock and $20$ o'clock. At $30$ minutes past $12$ o'clock, it is on, so we print Yes
.
Sample Input 2
20 7 12
Sample Output 2
No
The light is on between $0$ o'clock and $7$ o'clock, and between $20$ o'clock and $0$ o'clock (on the next day). At $30$ minutes past $12$ o'clock, it is off, so we print No
.
Sample Input 3
23 0 23
Sample Output 3
Yes
Input
题意翻译
高桥家每日 $s$ 时整开灯, $t$ 时整关灯。求 $x$ 点半的时候是不是开着灯?(注: $0≤s,t,x<24$ ,有可能半夜还开着灯)Output
分数:100分
问题描述
高桥君每天在$S$点(24小时制)打开房间的灯,每天在$T$点关闭灯。
灯亮着的时候日期可能会改变。
判断$X$点过$30$分钟灯是否亮着。
约束条件
- $0 \leq S, T, X \leq 23$
- $S \neq T$
- 输入中的所有值都是整数。
输入
输入标准输入,格式如下:
$S$ $T$ $X$
输出
如果$X$点过$30$分钟灯亮着,打印Yes
;否则,打印No
。
样例输入1
7 20 12
样例输出1
Yes
灯在$7$点到$20$点之间亮着。在$12$点过$30$分钟时,灯亮着,所以我们打印Yes
。
样例输入2
20 7 12
样例输出2
No
灯在$0$点到$7$点之间亮着,在$20$点到$0$点(第二天)之间亮着。在$12$点过$30$分钟时,灯灭了,所以我们打印No
。
样例输入3
23 0 23
样例输出3
Yes