James, being the egirl he is, likes to set quirky and cool messages as his Discord status!
James has a new Discord status he wants to use for a single contiguous (possibly empty) range of days within the next
Furthermore, because James is quirky and cool, the number of days for which the new status is applied must be a multiple of a given positive integer
Find the maximum number of egirl points James can gain within the next
Constraints
Subtask 1 [5%]
Subtask 2 [15%]
Subtask 3 [80%]
No additional constraints.
Input Specification
The first line contains two integers,
The next line contains
Output Specification
Output a single integer, the maximum number of egirl points James can gain by using his new Discord status on a contiguous subsequence of the next
Sample Input 1
5 2
1 3 2 -4 3
Sample Output 1
5
Explanation for Sample 1
James uses his new Discord status on days
Sample Input 2
4 3
1 2 -69 8
Sample Output 2
0
Explanation for Sample 2
James chooses not to apply his new Discord status at all, netting
Comments