Problem C
HKIO
Languages
en
is
Garðar is trying to optimize his program in the game HKIO. The program is written in assembly and he has been looking into how often each command in the program is executed. To that end he has run the program numerous times on different inputs and has tallied how often each command was executed. But now he wants to determine which section of the program is run the most on average. In other words, he wants to determine what contiguous subsequence of commands has the highest average number of executions. Can you help him? Garðar is too busy solving more HKIO programming challenges to do this himself.
Input
The first line of the input contains one positive integer
Output
Print the indices of the endpoints of the contiguous
subsequence with the highest average number of executions. If
more than one such pair of endpoints exist, print any one of
them. Do note that the first command is command number
Sample Input 1 | Sample Output 1 |
---|---|
7 1 0 0 2 2 2 0 |
3 5 |