import sys from collections import deque def main(): n, d, k = map(int, sys.stdin.readline().split()) x = [int(sys.stdin.readline()) for _ in range(n)] max_profit = 0 best_j = -1 best_k = -1 dq = deque() for current_k in range(1, n): j_current = current_k - 1 # Maintain the deque to have increasing values of x[j] while dq and x[dq[-1]] >= x[j_current]: dq.pop() dq.append(j_current) # Calculate the left boundary of the valid window left = max(0, current_k - d) # Remove elements out of the window's left boundary while dq and dq[0] < left: dq.popleft() if dq: current_j = dq[0] profit = (x[current_k] - x[current_j]) * k if profit > max_profit: max_profit = profit best_j = current_j best_k = current_k elif profit == max_profit: # Check if the new pair is lexicographically smaller if (current_j < best_j) or (current_j == best_j and current_k < best_k): best_j = current_j best_k = current_k if max_profit <= 0: print(0) else: print(max_profit) print(best_j, best_k) if __name__ == "__main__": main()