import sys from itertools import accumulate def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def solve(): N, D, K = map(int, input().split()) X = [int(sys.stdin.readline().rstrip()) for i in range(N)] Xac = list(accumulate(X)) mims = [] maxs = [] for i in range(N): if i == 0: if X[0] < X[1]: mims.append((i, X[i])) elif i == N - 1: if X[-1] > X[-2]: maxs.append((i, X[i])) else: if X[i - 1] < X[i] and X[i] >= X[i + 1]: maxs.append((i, X[i])) elif X[i - 1] >= X[i] and X[i] < X[i + 1]: mims.append((i, X[i])) max_dif = 0 j, k = None, None for p1, p2 in zip(mims, maxs): if p2[0] - p1[0] <= D: if p2[1] - p1[1] > max_dif: max_dif = p2[1] - p1[1] j, k = p1[0], p2[0] else: j1, k1, dif = find_maxdif(Xac, p1[0], p2[0], D) if dif > max_dif: j, k = j1, k1 max_dif = dif if max_dif <= 0: print(0) else: print(max_dif * K) print(j, k) def find_maxdif(Xac, l, r, D): res = 0 j, k = 0, 0 for i in range(l, r + 1 - D): if Xac[i + D] - Xac[i] > res: res = Xac[i + D] - Xac[i] j, k = i, i + D return j, k, res if __name__ == '__main__': solve()