What books can lead to...
The author of the daily tasks sits in the library every day, which has a bad effect on his mental state. As you can see, all the tasks in this contest are about books, what will be next...
You have books, where the -th book has an interestingness rating of . You want to read some of them to get the maximum satisfaction, i.e., so that the interestingness of the read books is maximal. However, the interestingness of read books is not always equal to the sum of their interestingness ratings. Over time, you start getting bored of reading, and each subsequent book will be less interesting than the previous ones. More formally, if you have a set of books, the interestingness of reading them will be equal to , where is the size of the set .
Find the maximum interestingness rating over all subsegments () of the array .
Input
The first line contains an integer () — the number of books.
The second line contains integers () — the interestingness ratings of the books.
Output
Output a single integer — the answer to the problem.
Examples
Scoring
Solutions that work correctly for will receive at least points.
Solutions that work correctly for for all will receive at least points.