402577: GYM100812 D Dream of Sum
Description
Sometimes you must fall in order to rise but I seemed to be already dead. The abyss behind me was getting the bigger the further I was moving away of it. I turned around, looked into it and saw myself at the very bottom of it. And at that moment I realized I was still alive.
I was sleeping, and the shadows of the past took advantage of it to take their shapes. I saw my wife and my daughters. They were dead. I also saw the sequence a1, ..., an of n integers. I had to find some consecutive elements in this sequence such that their sum was equal to zero. It was a matter of life and death. I had no time so I had to find the minimal possible number of such elements.
InputThe first line contains a single integer n (1 ≤ n ≤ 2·105) — the length of the sequence from the dream.
The second line contains n integers separated by spaces: ai ( - 109 ≤ ai ≤ 109) — the sequence itself.
OutputOutput two integers separated by a space: the 1-based position in the sequence, starting from which the consecutive elements must be taken, and how many elements must be taken. If there are several possible answers, output any of them. If it's impossible to find the elements satisfying the statement, output a single integer –1 instead.
ExamplesInput8Output
1 3 -2 -1 -5 2 2 1
2 3Input
7Output
5 -1 -1 -1 -1 -1 2
5 3