Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/minmax/largest-sum-of-an-adjacent-pair

Largest sum of an adjacent pair

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Easy 1000 ms 128 MB 32%
Share

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.

Choosing the largest among the sums of adjacent pairs

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

Sign in to submit a solution

Signing up is free and takes a minute.