#K34047. Top Candidate Finder

    ID: 25222 Type: Default 1000ms 256MiB

Top Candidate Finder

Top Candidate Finder

Given a list of vote counts for \(n\) candidates, determine the candidate(s) with the highest percentage of total votes. The percentage for candidate \(i\) is calculated as \(\frac{votes_i}{\sum_{j=0}^{n-1} votes_j}\) when the total votes are non-zero. In the case where the total votes are zero, all candidates are considered winners. Your task is to output the index (or indices) of the candidate(s) who received the highest percentage of votes.

inputFormat

The input consists of two lines. The first line contains an integer (n) representing the number of candidates. The second line contains (n) space-separated integers; the (i)-th integer represents the number of votes for candidate (i).

outputFormat

Output a single line containing the index(es) of the candidate(s) with the highest percentage of votes, separated by a single space. If the total number of votes is zero, output all indices from 0 to (n-1).## sample

3
10 20 30
2

</p>