Boolean
Boolean-11
Boolean-12
Boolean-13
~/algor $ cat problems/ikki-kesmaning-birida
In one of two segments?
Easy
1000 ms
64 MB
14%
Two segments $[a; b]$, $[c; d]$ and a number $x$ are given on the number line. The ends of a segment belong to it too. Check whether the statement is true: “the number $x$ lies in at least one of the segments”.
Input
One line with five integers: $a$, $b$, $c$, $d$ and $x$.
Output
One integer: $1$ if the statement is true, otherwise $0$.
Note
$-10^{9} \le a \le b \le 10^{9}$
$-10^{9} \le c \le d \le 10^{9}$
$-10^{9} \le x \le 10^{9}$
Examples
Input #1
1 4 7 9 8
Output #1
1
Input #2
1 4 7 9 5
Output #2
0