#Lutece2969. A very easy problem of sequence
A very easy problem of sequence
Migrated from Lutece 2969 A very easy problem of sequence
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
You have been given an array consisting of positive integers, you need to construct an array with the same length, which satisfy the following conditions:
- for each : ;
- there exist a position that for each : when , and when .
Please output the maximum sum of the array .
Input
The first line contains an integer . The second line contains positive integers .
Output
One positive integer, the maximum sum of the array .
Samples
6
1 1 4 5 1 4
13
Constraints
; .