#K74757. Delivery Slot Conflict Checker

    ID: 34268 Type: Default 1000ms 256MiB

Delivery Slot Conflict Checker

Delivery Slot Conflict Checker

You are given several test cases. In each test case, there are several delivery time slots, each defined by a start time and an end time. Your task is to determine whether any two time slots overlap. Two slots are considered to conflict if for any two consecutive slots (after sorting by start time) the start time of the later slot is strictly less than the end time of the former slot.

Formally, for each test case, given intervals \([s_i, e_i]\) for \(i=1,2,\ldots,n\), first sort the intervals by \(s_i\). Then, if there exists an index \(i\) such that \[ s_{i} < e_{i-1}, \] there is a conflict. Otherwise, there is no conflict.

Input Format: The first line contains an integer \(T\) representing the number of test cases. For each test case, the first line contains an integer \(n\) representing the number of delivery slots. This is followed by \(n\) lines, each with two integers indicating the start and end times of a delivery slot.

Output Format: For each test case, output either Conflict or No Conflict on a separate line depending on whether there is any overlapping time slot.

inputFormat

The input is read from standard input (stdin) and is formatted as follows:

T
n
s1 e1
s2 e2
... 

(repeat for T test cases)

</p>

Where:

  • \(T\) is the number of test cases.
  • For each test case, \(n\) is the number of delivery slots.
  • Each delivery slot is represented by two integers: the start time and the end time.

outputFormat

For each test case, output a single line with either "Conflict" if any two slots overlap, or "No Conflict" if none of the slots conflict.

## sample
1
3
9 10
12 13
11 12
No Conflict

</p>