#K1376. Flower Blooming Overlap Checker

    ID: 23984 Type: Default 1000ms 256MiB

Flower Blooming Overlap Checker

Flower Blooming Overlap Checker

In this problem, you are given several test cases. For each test case, you will receive information about different flowers, where each flower is described by its blooming start day and its duration. The blooming period for a flower starting on day (s) with duration (d) is defined as the interval ([s, s+d-1]). Two flowers are considered to have an overlap if their blooming intervals share at least one common day.

Formally, given two intervals ([s_1, s_1+d_1-1]) and ([s_2, s_2+d_2-1]), they overlap if and only if: [ \max(s_1, s_2) \leq \min(s_1+d_1-1, s_2+d_2-1) ]

Your task is to determine, for each test case, whether there exists any pair of flowers with overlapping blooming periods. If such a pair exists, print "Overlap"; otherwise, print "No Overlap".

inputFormat

The input is read from standard input (stdin). The first line contains an integer (T) representing the number of test cases. For each test case, the first line contains an integer (F) representing the number of flowers. Then, (F) lines follow, each containing two integers (S) and (D) representing the start day and the duration of a flower, respectively.

outputFormat

For each test case, output a single line on standard output (stdout) containing either "Overlap" if there is any overlap among the blooming periods of any two flowers, or "No Overlap" if there is no overlap.## sample

4
3
1 10
11 5
16 3
2
5 10
10 5
1
1 10
2
1 10
1 10
No Overlap

Overlap No Overlap Overlap

</p>