n, c = map(int, input().split()) lst1 = [] lst = list(map(int, input().split())) for k in range(0, n): if k == 0: t = c*(n-k) else: t = max(lst[:k]) + c*(n-k) lst1.append([k, t]) lst1.sort(key=lambda x: (x[1], x[0])) print(lst1[0][0], lst1[0][1])