MaxSum
You are given a sequence of N ( 1 <= N <= 100,000) numbers A1 , ..., AN (-2^31 < Ai < 2^31). Determine maximum sum of succesive elements in the sequence.
Input The first line of standard input contains only number N . The following N lines contain numbers A1 through AN , in order.
Output Print an integer to the standard output representing the maximum sum.
Input:
6
5
-6
1
2
3
-3Output:
6 Input:
4
1
2
1
-2Output:
4 Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.