#P6821. [PA 2012] Tanie linie
[PA 2012] Tanie linie
Description
Given a sequence containing numbers, find the maximum possible sum of at most non-overlapping subarrays.
Input Format
The first line contains two positive integers .
The next line contains integers, which form the sequence.
Output Format
Output one integer, the answer.
5 2
7 -3 4 -9 5
13
Hint
For of the testdata, . All numbers in the sequence are within .
Translated by ChatGPT 5
京公网安备 11011102002149号