import sequtils,strutils,deques var N,D,K : int x,M,m,sd,bd : int deq = initDeque[int](1024) (N,D,K) = stdin.readline.split.map(parseInt) var X = newSeq[int](N) M = 0 for n in 0.. 0: if deq.peekFirst + D < n: deq.popFirst if deq.len > 0 and x - X[deq.peekFirst] > M: M = x - X[deq.peekFirst] bd = deq.peekFirst sd = n while deq.len > 0 and X[deq.peekLast] > x: deq.popLast deq.addLast(n) var ans : int64 ans = M.int64 * K.int64 echo ans if ans > 0: echo bd," ",sd