N,D=map(int,input().split()) a=[0]+[*map(int,input().split())] b=[0] for i in range(1,N): a[i]+=a[i-1] b.append(D+a[i]-(a[i]-b[i-1]) if (a[i]-b[i-1])