/* Question: for a certain interval, the sum of the two non-cross intervals must be the largest, and the minimum values of left_a and left_ B that meet the condition are analyzed as follows: the DP compression interval value, maintain the sum value */# include <iostream> # include <algorithm> # include <string> # include <cmath> # include <cstdio> using namespace STD; # define Manx 200009 long DP [Manx], Maxx, sum; int A [Manx]; int main () {int N, K, pos_a, pos_ B, BB; scanf ("% d", & N, & K); For (INT I = 1; I <= N; I ++) scanf ("% d ", & A [I]); For (INT I = 1; I <= K; I ++) DP [1] + = A [I]; for (INT I = k + 1; I <= N; I ++) DP [I-k + 1] = DP [I-K]-A [I-K] + A [I]; // compress for (INT I = n-2 * k + 1; I> = 1; I --) {If (Maxx <= DP [I + k]) maxx = DP [I + K], BB = I + k; // If (sum <= Maxx + dp [I]) sum = Maxx + dp [I], pos_a = I, pos_ B = BB; // requires that the two segments do not have cross intervals and the maximum} printf ("% d \ n", pos_a, pos_ B );}