#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INF_LL 1e18 #define INF 1e9 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(x) x.begin(),x.end() using namespace std; using ll = long long; using PII = pair; template void chmax(T &a, T &b){ a = max(a, b); } template void chmin(T &a, T &b){ a = min(a, b); } class Union_find{ private: vector par; vector rank; int n; public: Union_find(int a){ n = a; for(int i = 0;i < n;i++){ par.push_back(i); rank.push_back(0); } } int find(int x){ if(par[x] == x){ return x; }else{ return par[x] = find(par[x]); } } void unite(int x, int y){ x = find(x); y = find(y); if(x == y) return; if(rank[x] < rank[y]){ par[x] = y; }else{ par[y] = x; if(rank[x] == rank[y]) rank[x]++; } } bool same(int x, int y){ return find(x) == find(y); } }; class RMQ{ vector dat; int n; public: RMQ(vector v){ n = 1; while(n < v.size()) n *= 2; REP(i, n*2-1){ dat.push_back(INF); } REP(i, v.size()){ dat[i+n-1] = v[i]; } for(int i = n-2;i >= 0;i--){ dat[i] = min(dat[i*2+1], dat[i*2+2]); } } void update(int x, int i){ i += n-1; dat[i] = x; while(i > 0){ i = (i-1)/2; dat[i] = min(dat[i*2+1], dat[i*2+2]); } } int query(int a, int b, int l, int r, int k){ if(a <= l && r <= b) return dat[k]; if(b <= l || r <= a) return INF; return min(query(a, b, l, (l+r)/2, k*2+1), query(a, b, (l+r)/2, r, k*2+2)); } int query(int a, int b){ return query(a, b, 0, n, 0); } }; int main(void){ cin.tie(0); ios::sync_with_stdio(false); int N, D, K; int x[114514]; vector v; cin >> N >> D >> K; ll res = 0; int l = 0, r = 0; REP(i, N){ cin >> x[i]; v.push_back(x[i]); } RMQ rmq(v); FOR(i, 1, N){ ll ret = (ll)K*((ll)x[i]-(ll)rmq.query(max(i-D, 0), i)); if(ret > res){ res = ret; l = max(i-D, 0); r = i; FOR(j, max(i-D, 0), i){ if(x[l] > x[j]){ l = j; } } } } if(res == 0){ cout << 0 << endl; return 0; } cout << res << endl; cout << l << " " << r << endl; }