Автор: | 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 |
|
|