Range Intersection Check
1.0s 256MGiven two closed intervals \([a1, b1]\) and \([a2, b2]\) on the number line, determine whether there is at least one point that lies in both intervals.
Input
The input consists of a single line containing four integers \(a1\), \(b1\), \(a2\), and \(b2\) in that order. (\(-10^9 \le a1 \le b1 \le 10^9, -10^9 \le a2 \le b2 \le 10^9\))
Output
If there is at least one point that exists in both intervals \([a1, b1]\) and \([a2, b2]\), output Yes; otherwise, output No.
Sample Input 1
1 3 3 4
Sample Output 1
Yes
Sample Input 2
7 9 3 5
Sample Output 2
No
Sample Input 3
0 0 -1000000000 1000000000
Sample Output 3
Yes
Log in to write and submit code. Creating an account is free.