#include #define M_PI 3.14159265358979323846 // pi using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector VI; typedef pair P; typedef tuple t3; typedef tuple t4; typedef tuple t5; #define rep(a,n) for(ll a = 0;a < n;a++) #define repi(a,b,n) for(ll a = b;a < n;a++) using namespace std; static const ll INF = 1e15; const ll mod = 1000000007; template static inline void chmin(T & ref, const T value) { if (ref > value) ref = value; } template static inline void chmax(T& ref, const T value) { if (ref < value) ref = value; } int main() { ll n, day, k; cin >> n >> day >> k; vector vs(n); rep(i, n) cin >> vs[i]; deque deq; rep(i, day+1) { while (!deq.empty() && vs[deq.front()] <= vs[i]) { deq.pop_front(); } deq.push_back(i); } ll up = 0; ll o1 = 0, o2 = 0; for (int i = 0; i < n; i++) { auto o = vs[i]; auto t = vs[deq.front()]; if (up < t - o) { o1 = i; o2 = deq.front(); up = t - o; } if (deq.front() == i) { deq.pop_front(); } if (i + day + 1 < n) { while (!deq.empty() && vs[deq.front()] <= vs[i+day + 1]) { deq.pop_front(); } deq.push_back(i + day + 1); } } cout << up * k << endl; if (up > 0) { cout << o1 << " " << o2 << endl; } return 0; }