Sponsored
Use these hints if you're stuck. Try solving on your own first.
Solve the problem for every interval alone.
Divide the problem into cases according to the position of the two intervals.
Solve with full IDE support and test cases