Задача G. Greedy replacement

Автор:M. Sporyshev   Ограничение времени:1 сек
Входной файл:Стандартный вход   Ограничение памяти:512 Мб
Выходной файл:Стандартный выход  

Условие

Let we have array of integers ai. You can select in it no more than one number and replace it to other. Cost of this replacement is absolute difference new and old numbers.

It is required to find replacement with a minimum cost, so that a pair of same elements appears in the array of prefix sums of this array.

Формат входных данных

First line of input data contains single number N — length of the array.

Second line contains the N integers ai.

Формат выходных данных

Output data must contains two integer numbers — index of element for replacement (starting by zero) and signed difference between new and old its values.

If there are many solutions, than output any from them.

Ограничения

2 < N < 100000

|ai| ≤ 109

Примеры тестов

Стандартный вход Стандартный выход
1
2
1 1
1 -1
2
3
1 2 -3
2 1

0.068s 0.015s 13