#C1248. Conflicting Tasks Finder
Conflicting Tasks Finder
Conflicting Tasks Finder
You are given n tasks, each with a start time, an end time, and a resource label. Two tasks conflict if they use the same resource and their time intervals overlap. The time interval for the ith task is represented as \( [s_i, e_i) \), and two tasks do not overlap if one finishes exactly when the other starts, i.e. if \( e_i \leq s_j \) or \( e_j \leq s_i \). Otherwise, the tasks are said to conflict.
Your goal is to determine the first pair (in order of increasing indices) of tasks that conflict. If no such pair exists, output "no conflicts".
inputFormat
The input is read from standard input. The first line contains an integer n which denotes the number of tasks. Each of the next n lines contains two integers and a string: start, end, and resource respectively. It is guaranteed that for each task, start is less than end.
outputFormat
Output a single line to standard output. If a conflicting pair of tasks is found, output the two 1-based indices (space-separated) corresponding to the first conflicting pair identified. Otherwise, output "no conflicts".
## sample4
2 5 A
4 6 A
1 3 B
7 8 A
1 2
</p>