#include #include #include #include #include #include #include #include #include using namespace std; int main() { int n, d, k; cin >> n >> d >> k; vector x(n); for (int i = 0; i < n; i++) { scanf("%d", &x[i]); } deque q; tuple mx(-1, 0, 0); for (int i = 0; i < n; i++) { while (!q.empty() && i - q.front() > d) { q.pop_front(); } while (!q.empty() && x[q.back()] >= x[i]) { q.pop_back(); } if (!q.empty()) { mx = max(mx, make_tuple(x[i] - x[q.front()], -q.front(), -i)); } q.push_back(i); } int foo, bar, baz; tie(foo, bar, baz) = mx; if (foo == -1) { cout << 0 << endl; } else { cout << 1LL * foo * k << endl; cout << -bar << " " << -baz << endl; } }