#include using namespace std; #define rep(i,n) for (int i=0;i<(n);i++) #define rep2(i,a,b) for (int i=(a);i<(b);i++) #define rrep(i,n) for (int i=(n)-1;i>=0;i--) #define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--) #define all(a) (a).begin(),(a).end() #define ifnot(x) if(not(x)) #define dump(x) cerr << #x << " = " << (x) << endl; typedef long long ll; typedef unsigned long long ull; typedef pair P; int N, D, K; int n; int x [100000]; int st [262144]; int inds[262144]; void init() { for (n = 1; n < N; n *= 2); rep(i, N) { st[n + i] = x[i]; inds[n + i] = i; } rrep2(i, 1, n) { st[i] = max(st[i*2], st[i*2 + 1]); inds[i] = inds[i*2 + ((st[i*2] >= st[i*2 + 1]) ? 0 : 1)]; } } P query(int a, int b, int k, int l, int r) { if (r <= a || b <= l) return P(0, n); if (a <= l && r <= b) return P(st[k], inds[k]); P v1 = query(a, b, k * 2 , l, (l + r) / 2); P v2 = query(a, b, k * 2 + 1, (l + r) / 2, r); return max(v1, v2, [](const P v1, const P v2) { if (v1.first == v2.first) return v1.second > v2.second; return v1.first < v2.first; }); } P run_query(int a, int b) { return query(a, b, 1, 0, n); } void solve() { cin >> N >> D >> K; rep(i, N) cin >> x[i]; init(); int max_dif = 0, max_i = 0, max_j = 0; rep(i, N) { P res = run_query(i, i + D + 1); int dif = res.first - x[i]; if (max_dif < dif) { max_dif = dif; max_i = i; max_j = res.second; } } ll wealth = K * max_dif; cout << wealth << endl; if (wealth) cout << max_i << ' ' << max_j << endl; } int main() { solve(); return 0; }