#C1127. Overlapping Intervals

    ID: 40567 Type: Default 1000ms 256MiB

Overlapping Intervals

Overlapping Intervals

You are given a set of intervals on the number line. Each interval is represented by a pair of integers indicating its start and end. Your task is to determine whether any two intervals overlap.

Two intervals \( (a, b) \) and \( (c, d) \) are said to overlap if and only if \( c < b \) and \( a < d \). Note that if one interval ends exactly when another starts, they are not considered overlapping.

Example:

Input:
3
1 5
3 7
8 10

Output: True

</p>

inputFormat

The first line of input contains a single integer ( n ), the number of intervals. Each of the following ( n ) lines contains two space-separated integers ( a ) and ( b ), representing an interval from ( a ) to ( b ).

outputFormat

Print "True" if any two intervals overlap; otherwise, print "False".## sample

3
1 5
3 7
8 10
True