We were afraid of making this problem statement too boring, so we decided to keep it short. A sequence is called non-boring if its every connected subsequence contains a unique element, i.e. an element such that no other element of that subsequence has the same value. Given a sequence of integers, decide whether it is non-boring.
The first line of the input contains the number of test cases T. The descriptions of the test cases follow:
Each test case starts with an integer N (1 ≤ N ≤ 200000) denoting the length of the sequence. In the next line the N elements of the sequence follow, Xi, separated with single spaces.
Print the answers to the test cases in the order in which they appear in the input. For each test case print a single line containing the word non-boring or boring.
For all subtasks: 1 ≤ T ≤ 5, 1 ≤ N ≤ 200000, 0 ≤ Xi ≤ 109
Subtask 1 (9%): 1 ≤ N ≤ 100, 0 ≤ Xi ≤ 106
Subtask 2 (42%): 1 ≤ N ≤ 1000, 0 ≤ Xi ≤ 106
Subtask 3 (49%): No additional contraints
Subtask 4 (0%): Sample Testcases
4 5 1 2 3 4 5 5 1 1 1 1 1 5 1 2 3 2 1 5 1 1 2 1 1
non-boring boring non-boring boring
Subtask | Score |
---|---|
1 | 9 |
2 | 42 |
3 | 49 |
4 | 0 |