#K91487. Predominant Flower Size
Predominant Flower Size
Predominant Flower Size
You are given several test cases. In each test case, you are provided with a list of integers which represent the sizes of different flowers.
Your task is to determine if there is a predominant flower size, defined as a size that appears more than \(\lfloor n/3 \rfloor\) times, where \(n\) is the total number of flowers in the test case. If such a flower size exists, print that size; otherwise, print "NO PREDOMINANT SIZE".
Note: The comparison is strictly based on the count being greater than \(\lfloor n/3 \rfloor\).
inputFormat
The input begins with an integer \(T\) denoting the number of test cases. For each test case:
- The first line contains an integer \(n\) representing the number of flowers.
- The second line contains \(n\) integers separated by spaces, representing the sizes of the flowers.
outputFormat
For each test case, output the predominant flower size if one exists; otherwise, output "NO PREDOMINANT SIZE". Each result should be printed on a new line.
## sample5
8
4 2 3 4 4 2 5 4
7
1 2 1 3 1 1 2
8
1 2 3 4 5 6 7 8
8
1 1 1 1 2 2 2 3
7
2 2 2 1 1 1 2
4
1
NO PREDOMINANT SIZE
1
2
</p>