~/algor $ cat problems/if-oraliqqa-keltirish
Clamp to a range
Easy
1000 ms
64 MB
21%
Integers $L$, $R$ ($L \le R$) and $x$ are given. Clamp $x$ to the range $[L; R]$: if $x < L$, take $L$; if $x > R$, take $R$; otherwise take $x$ itself.
Input
One line with three integers: $L$, $R$ and $x$.
Output
One integer — the value in the range.
Note
$-10^{9} \le L \le R \le 10^{9}$
$-10^{9} \le x \le 10^{9}$
Examples
Input #1
2 7 9
Output #1
7
Input #2
2 7 4
Output #2
4