#include using namespace std; #define _p(...) (void)printf(__VA_ARGS__) #define forr(x,arr) for(auto&& x:arr) #define _overload3(_1,_2,_3,name,...) name #define _rep2(i,n) _rep3(i,0,n) #define _rep3(i,a,b) for(int i=int(a);i=int(a);i--) #define rrep(...) _overload3(__VA_ARGS__,_rrep3,_rrep2,)(__VA_ARGS__) #define all(x) (x).begin(), (x).end() #define bit(n) (1LL<<(n)) #define sz(x) ((int)(x).size()) #define fst first #define snd second using ll=long long; using pii=pair;using pll=pair;using pil=pair;using pli=pair; using vs=vector;using vvs=vector;using vvvs=vector; using vb=vector;using vvb=vector;using vvvb=vector; using vi=vector;using vvi=vector;using vvvi=vector; using vl=vector;using vvl=vector;using vvvl=vector; using vd=vector;using vvd=vector;using vvvd=vector; using vpii=vector;using vvpii=vector;using vvvpii=vector; templateistream&operator>>(istream&is,pair&P){is>>P.fst;is>>P.snd;return is;} templateT read(){T t;cin>>t;return t;} templateostream&operator<<(ostream&o,const pair&p){return o<<'('<ostream&operator<<(ostream&o,const vector&t){o<<"{";rep(i,sz(t))o<void e_r_r(vs::iterator it,T a,Args... args){cerr<substr((*it)[0]==' ',it->length())<<" = "< struct SegTreeMax0 { const int n; vector val; SegTreeMax0(int _n): n(p2(_n)), val(n * 2) {} void reinit() { val.fill({-1, -1}); } V getval(int a, int b) { return getval(a, b, 0, 0, n); } void update(int i, V v) { i += n - 1; val[i] = v; while (i > 0) { i = (i - 1) / 2; val[i] = max(val[i * 2 + 1], val[i * 2 + 2]); } } private: V getval(int a, int b, int k, int l, int r) { if (r <= a || b <= l) return {-1, -1};; if (a <= l && r <= b) return val[k]; return max(getval(a, b, k * 2 + 1, l, (l + r) / 2), getval(a, b, k * 2 + 2, (l + r) / 2, r)); } static int p2(int n, int m=1) { return m >= n ? m : p2(n, m * 2); } }; template bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } void Main() { int n = read(); int d = read(); int k = read(); vector A(n); rep(i, n) A[i] = read(); SegTreeMax0 seg(n); rep(i, n) { seg.update(i, {A[i], -i}); } int ans = 0; int l=0, r=0; rep(i, n) { int a = A[i]; pii b = seg.getval(i, i+d+1); if (amax(ans, b.fst - a)) { l = i; r = -b.snd; } } if ( ans == 0) { cout << 0 << endl; } else { cout << (ans*k) << endl; cout << (l) << ' ' << (r) << endl; } } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); Main(); return 0; }