~/algor $ cat problems/dokon-ochiqmi
Is the shop open?
Every day a shop opens at $h_{1}$ hours $m_{1}$ minutes and closes at $h_{2}$ hours $m_{2}$ minutes (in $24$-hour format). If the closing time is earlier than the opening time, the shop closes after midnight, on the next day: for example, from $22$ hours $0$ minutes to $2$ hours $0$ minutes. The shop is open at the opening minute and closed at the closing minute. Check whether the statement is true: “the shop is open at $h$ hours $m$ minutes”.
Input
The first line contains four integers: $h_{1}$, $m_{1}$, $h_{2}$ and $m_{2}$.
The second line contains two integers: $h$ and $m$.
Output
One integer: $1$ if the statement is true, otherwise $0$.
Note
$0 \le h_{1}, h_{2}, h \le 23$
$0 \le m_{1}, m_{2}, m \le 59$
The opening and closing times are different.
Examples
22 0 2 0 1 30
1
9 0 18 0 18 0
0