#include using namespace std; #define rep(i,a,b) for(int i=a;i struct IRMXQ { // by natsugiri vector A; vector > M, X; IRMXQ() {} IRMXQ(const vector &A_) : A(A_) { int N = A.size(), LOGN = __lg(N) + 1; M.resize(LOGN); X.resize(LOGN); for (int i = 0; i> N >> D >> K; rep(i, 0, N) cin >> X[i]; IRMXQ rmq(vector(X, X + N)); int L = -1, R = -1, C = 0; rep(i, 0, N - 1) { int a = X[i]; int b = rmq.max_v(i + 1, i + D + 1); int d = b - a; if (C < d) { C = d; L = i; R = rmq.max_i(i + 1, i + D + 1); } } if (L < 0) { printf("0\n"); return 0; } printf("%lld\n", 1LL * C * K); printf("%d %d\n", L, R); }