Problem B
Primal Partitions
The Math department has challenged the Computer Science department at your University to solve a difficult puzzle in Discrete Mathematics. With the pride of your Computer Science department at stake, you must solve this puzzle!
In this puzzle, you are given a sequence of
Your task is to find the maximum possible score. The Math department will win if their score is better, so be sure to find the maximum each time!
Input
Each input will consist of a single test case. Note that
your program may be run multiple times on different inputs.
Each input begins with a line with two space-separated integers
Output
Output a single integer representing the maximum score
possible partitioning the sequence of
Sample Input 1 | Sample Output 1 |
---|---|
5 3 10 5 4 8 3 |
2 |
Sample Input 2 | Sample Output 2 |
---|---|
5 3 10 11 12 13 14 |
0 |