Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/oraliqda-yotadimi

Does it lie in the segment?

Easy 1000 ms 64 MB 14%
Share

Three integers $a$, $b$ and $x$ are given. Check whether the statement is true: “the number $x$ lies in the segment $[a; b]$”, that is, $a \le x \le b$.

A point lying inside a segment

Input

One line with three integers: $a$, $b$ 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 x \le 10^{9}$

Examples

Input #1
1 10 5
Output #1
1
Input #2
1 10 11
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.