#P17282. 「IXOI R2」跟你爆了
「IXOI R2」跟你爆了
Background

Your useless classmate is stuffing your head with meaningless information, so you decide you’re done with him.
Problem Description
Specifically, your classmate said pieces of nonsense. The -th piece contains information amount , so what he said can be seen as a sequence of length : .
Define the information density of an interval as the total information amount in this interval divided by the interval length. That is, the information density of is .
To be done with your classmate, you decide to find the consecutive segment of his words with the lowest information density. In other words, you need to find a subinterval of the sequence such that the information density of this interval is minimized.
To avoid letting your classmate notice that you are picking a fight, this information density cannot be .
Input Format
The first line contains an integer , representing the number of nonsense statements your classmate said.
The second line contains space-separated integers , representing the information amount of each statement.
Output Format
Output one line with two positive integers separated by a space, meaning that among all consecutive segments with non-zero information density, the minimum information density is .
Note that the fraction must be in lowest terms. In particular, if after simplification the result is an integer, then .
5
0 2 0 1 0
1 3
Hint
This problem uses bundled testdata.
| Subtask | Special Property | Score | |
|---|---|---|---|
| None | |||
| Yes | |||
| None |
Special property: It is guaranteed that there is only one value in the sequence that is greater than .
For all testdata, it is guaranteed that:
, , and the maximum value of the sequence is non-zero.
Translated by ChatGPT 5