The subarray sum

0

0 votes
Problem

Given an array of n integers, Steve now wonders what can be the maximum sum of a sub-array. Help him find the answer.

Input

The first line of input contains an integer n: The number of elements in array

The second line contains array of n integers.

Output

Print one integer: Maximum sum of any of the subarray,

Constraints

(1n105)

(109Ai109)

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?