~/algor $ cat problems/minmax/largest-sum-of-an-adjacent-pair
Largest sum of an adjacent pair
Easy
1000 ms
128 MB
32%
A positive integer and integers are given. Among the sums of two adjacent elements (), find the largest one and the first at which it is reached.
Input
The first line contains a positive integer . The next line contains integers .
Output
One line with two integers separated by a space: the largest sum and the first such .
Note
Examples
Input #1
6 3 8 2 9 1 5
Output #1
11 1
Input #2
2 -4 -6
Output #2
-10 1