#include using namespace std; #define int long long #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif template struct SegmentTree{ using F = function; F f; T inf; int n; vector node; SegmentTree(vector v,T inf,F f):inf(inf),f(f){ n = 1; while(n < v.size()) n *= 2; node.resize(2*n-1,inf); for(int i = 0; i < v.size(); i++) node[i+n-1] = v[i]; for(int i = n-2; i >= 0; i--) node[i] = f(node[2*i+1],node[2*i+2]); } void update(int k,T val){ k += n-1; node[k] = val; while(k > 0){ k = (k-1) / 2; node[k] = f(node[2*k+1],node[2*k+2]); } } void add(int k,T val){ k += n-1; node[k] += val; while(k > 0){ k = (k-1) / 2; node[k] = f(node[2*k+1],node[2*k+2]); } } T getval(int a,int b){ return getval(a,b,0,0,n); } T getval(int a,int b,int k,int l,int r){ //区間[a, b)の値を返す if(r <= a || b <= l) return inf; if(a <= l && r <= b) return node[k]; T vl = getval(a, b, 2*k+1, l, (l+r)/2); T vr = getval(a, b, 2*k+2, (l+r)/2, r); return f(vl, vr); } }; using P = pair; const P INF = {1<<30,1<<30}; signed main(){ int n,d,k; cin >> n >> d >> k; vector

x(n); for(int i = 0; i < n; i++){ int a; cin >> a; x[i] = {a,i}; } SegmentTree

seg(x,INF,[&](P x,P y){ return min(x,y); }); P ans = {-1<<30,-1<<30}; int l = 0; for(int i = 1; i < n; i++){ P res = seg.getval(max(0LL,i-d),i+1); int j = x[i].first - res.first; if(ans.first < j){ ans = {j,res.second}; l = i; } } if(ans.first <= 0) cout << 0 << endl; else { cout << ans.first * k << endl; cout << ans.second << " " << l << endl; } return 0; }