#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; struct Node { int day; int x; Node(int day = -1, int x = -1) { this->day = day; this->x = x; } bool operator>(const Node &n) const { return x > n.x; } }; int main() { int N, D, K; cin >> N >> D >> K; priority_queue , greater> pque; int X[N]; for (int i = 0; i < N; ++i) { cin >> X[i]; } pque.push(Node(0, X[0])); int ans = 0; int j = -1; int k = -1; for (int day = 1; day <= N - 1; ++day) { int x = X[day]; while (day - pque.top().day > D) { pque.pop(); } int diff = x - pque.top().x; if (ans < diff * K) { ans = diff * K; j = pque.top().day; k = day; } pque.push(Node(day, x)); } if (ans == 0) { cout << 0 << endl; } else { cout << ans << endl; cout << j << " " << k << endl; } return 0; }