#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())<<" = "< vector slideMinimum(const vector &a, int k) { int n = a.size(); deque deq; vector ret; for (int i = 0; i < n; i++) { while (!deq.empty() && a[deq.back()] <= a[i]) deq.pop_back(); deq.push_back(i); if (i - k + 1 >= 0) { ret.push_back(deq.front()); if (deq.front() == i - k + 1) deq.pop_front(); } } return ret; } 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(); ll k = read(); vector A(n); rep(i, n) A[i] = read(); rep(i, d) A.emplace_back(A.back()); vi sm = slideMinimum(A, d+1); int ansi = -1; int ans = 0; rep(i, n) { int a = A[i]; int ma = A[sm[i]]; if (ma <= a) continue; if (amax(ans, ma - a)) { ansi = i; } } cout << ans * k << endl; if (ans == 0) { return; } rep(i, ansi, n) { if (A[i] - A[ansi] == ans) { cout << ansi << ' ' << i << endl; return; } } assert(false); } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); Main(); return 0; }