#include #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) for(int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; const int INF = 2000000000; using namespace std; int main(){ int n, d, k; int a[100005]; cin >> n >> d >> k; rep(i,n) cin >> a[i]; d++; set> s; int i = 0, dif = 0; int day[2]; while(true){ if(i != n){ s.insert(make_pair(a[i],i)); i++; }else if(i == n && s.size() == 1) break; int temp = (--s.end())->first - a[i - s.size()]; //for(auto it:s){ cout << it.second<< endl; } //show(s.size()) show( s.begin()->first); show( (--s.end())->first); if(temp > dif){ dif = temp; day[0] = i - s.size(); day[1] = (--s.end())->second; } //show(a[i - d]) if(s.size() == d || i == n) s.erase(s.find(make_pair(a[i - s.size()], i - s.size()))); } cout << dif * k << endl; if(dif * k > 0) cout << day[0] << ' ' << day[1] << endl; }