UiB Warmup 3 (Fall 2017)

Start

2017-09-13 16:15 CEST

UiB Warmup 3 (Fall 2017)

End

2017-09-13 19:00 CEST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -9 days 13:47:01

Time elapsed

2:45:00

Time remaining

0:00:00

Problem H
Popular Vote

/problems/vote/file/statement/en/img-0001.png
In an election with more than two candidates, it is often the case that the winner (the candidate receiving the most votes) receives less than the majority of the votes. Given the results of an election, can you determine the winner, and whether the winner received more than half of the votes?

Input

The first line of input contains a single positive integer $T \leq 500$ indicating the number of test cases. The first line of each test case also contains a single positive integer $n$ indicating the number of candidates in the election. This is followed by $n$ lines, with the $i$th line containing a single nonnegative integer indicating the number of votes candidate $i$ received.

There are at least $2$ and no more than $10$ candidates in each case, and each candidate will not receive more than $50\, 000$ votes. There will be at least one vote cast in each election.

Output

Provide a line of output for each test case. If the winner receives more than half of the votes, print the phrase majority winner followed by the candidate number of the winner. If the winner does not receive more than half of the votes, print the phrase minority winner followed by the candidate number of the winner. If a winner cannot be determined because no single candidate has more vote than others, print the phrase no winner. The candidate numbers in each case are $1, 2, \ldots , n$.

Sample Input 1 Sample Output 1
4
3
10
21
10
3
20
10
10
3
10
10
10
4
15
15
15
45
majority winner 2
minority winner 1
no winner
minority winner 4