hdu1024(最大m子段和问题)

最大m子段和问题,具体参见hdu1024:http://acm.hdu.edu.cn/showproblem.php?pid=1024
input:Each test case will begin with two integers m and n, followed by n integers S1, S2, S3 ... Sn.
Process to the end of file.
output:Output the maximal summation described above in one line.
sample input:
1 3 1 2 3
2 6 -1 4 -2 3 -2 3
sample output:
6
8