#include #define rep(i,n) for(int i = 0; i < (n); ++i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) using namespace std; typedef long long int ll; typedef pair P; #define yn {puts("Yes");}else{puts("No");} #define MAX_N 200005 int main() { ll n, d, k; cin >> n >> d >> k; ll x[n*3] = {}; rep(i,n){ cin >> x[i]; x[i] *= k; } deque

deq; ll ans = 0; ll s = -1, t = -1; rep(i,d){ if(i == 0){ deq.push_back(P(x[i],i)); }else{ while(deq.size() > 0 && deq[deq.size()-1].first < x[i]){ deq.pop_back(); } deq.push_back(P(x[i],i)); } } rep(i,n){ while(deq.size() > 0 && deq[deq.size()-1].first < x[i+d]){ deq.pop_back(); } deq.push_back(P(x[i+d],i+d)); if(deq[0].second <= i)deq.pop_front(); if(ans < deq[0].first - x[i]){ ans = deq[0].first - x[i]; s = i; t = deq[0].second; } } if(ans == 0){ cout << 0 << endl; }else{ cout << ans << endl; cout << s << ' ' << t << endl; } return 0; }