#K53812. Overlapping Tasks Checker

    ID: 29615 Type: Default 1000ms 256MiB

Overlapping Tasks Checker

Overlapping Tasks Checker

You are given a list of tasks, each defined by a start time and an end time. Two tasks are considered overlapping if the start time of a task is strictly less than the end time of the previous task when tasks are sorted by start time. Note that if one task ends exactly when the next one starts, they are not overlapping.

Your task is to determine whether any two tasks overlap. In mathematical terms, given tasks \( (s_1,e_1), (s_2,e_2), \dots, (s_n,e_n) \) sorted by start time, check if there exists an index \( i \) (\( 2 \le i \le n \)) such that \( s_i < e_{i-1} \).

inputFormat

The input is read from standard input. The first line contains a single integer \( N \) representing the number of tasks. Each of the next \( N \) lines contains two space-separated integers \( s \) and \( e \), where \( s \) is the start time and \( e \) is the end time of a task.

outputFormat

Output a single line to standard output containing either True if there is any overlapping task, or False if none of the tasks overlap.

## sample
3
1 5
5 8
8 12
False