AdvancedRating 1600
Two Windows With the Biggest Sum
Choose two non-overlapping blocks of consecutive numbers, one of length L and one of length M (in either order). Print the largest total of both blocks.
Input
n, L and M (L + M ≤ n), then n integers.
Output
One integer.
Sample 1
Input
9 1 2 0 6 5 2 2 5 1 9 4
Output
20
Sample 2
Input
9 3 2 3 8 1 3 2 1 8 9 0
Output
29
Output appears here