#include using namespace std; #define endl '\n' typedef long long ll; const int N = 1e5 + 10; const int LG = 20; ll n, d, k; ll a[N]; struct Sparse_Table { ll lg[N]; struct Node { ll maxx, id; inline bool operator<(const Node &x) const { if (maxx == x.maxx) return id > x.id; return maxx < x.maxx; } } st[N][LG]; inline void init() { lg[1] = 0; for (ll i = 2; i <= n; i++) lg[i] = lg[i >> 1] + 1; for (ll i = 0; i <= n; i++) st[i][0] = {a[i], i}; for (ll p = 1; p < LG; p++) for (ll i = 0; i + (1 << p) - 1 <= n; i++) st[i][p] = max(st[i][p - 1], st[i + (1 << (p - 1))][p - 1]); } inline Node query(ll l, ll r) { ll k = lg[r - l + 1]; return max(st[l][k], st[r - (1 << k) + 1][k]); } } ST; int main(int argc, char const *argv[]) { ios::sync_with_stdio(false); cin.tie(nullptr), cout.tie(nullptr); cin >> n >> d >> k; for (ll i = 1; i <= n; i++) cin >> a[i]; ST.init(); ll ans = 0, in = 0, out = 0; for (ll i = 1; i <= n; i++) { ll l = min(i + 1, n), r = min(i + d, n); auto tmp = ST.query(l, r); if (tmp.maxx - a[i] > ans) { ans = tmp.maxx - a[i]; in = i, out = tmp.id; } } if (ans == 0) cout << 0 << endl; else cout << ans * k << endl << in - 1 << " " << out - 1 << endl; return 0; }