#include #include #include #include using namespace std; typedef long long int ll; const ll N = 100000; ll n, d, k, mx[N],p[N]; int ct[1000000] = {}; int mx_i = 0; int main() { cin >> n >> d >> k; for (int i = 0; i < n; i++)cin >> p[i]; mx[n - 1] = p[n - 1]; priority_queue mxq; mxq.push(p[n - 1]); ct[p[n - 1]]++; for (int i = n - 2; i >= 0; i--) { mxq.push(p[i]); ct[p[i]]++; if (i + d + 1 < n)ct[p[i + d + 1]]--; for (; ct[mxq.top()] == 0; mxq.pop()); mx[i] = mxq.top(); } for (int i = 1; i < n; i++) { if (mx[i] - p[i] > mx[mx_i] - p[mx_i])mx_i = i; } if (mx[mx_i] - p[mx_i] > 0) { cout << k * (mx[mx_i] - p[mx_i]) << endl; cout << mx_i << ' '; for (int i = mx_i; i < n; i++) { if (p[i] == mx[mx_i]) { cout << i << endl; break; } } } else cout << 0 << endl; return 0; }