poj2593(最大m子段和的简单应用)

最大m子段和的简单应用,具体参见poj2593:http://poj.org/problem?id=2593
input:The input will consist of several test cases. For each test case, one integer N (2 <= N <= 100000) is given in the first line. Second line contains N integers. The input is terminated by a single line with N = 0.
output:For each test of the input, print a line containing S.
sample input:
5
-5 9 -5 11 20
0
sample output:
40