N, T, *L = list(map(int, open(0).read().split()))

a, d = T, 0

for t in L:

    if a < t:

        d += t - a

    a = t + T

print((a - d))
N, T, *L = list(map(int, open(0).read().split()))

print((L[-1] + T - sum(b - a - T for a, b in zip(L, L[1:]) if b - a > T)))
N, T, *L = list(map(int, open(0).read().split()))
a, d = T, 0
for t in L:
    if a < t:
        d += t - a
    a = t + T
print((a - d))

N, T, *L = list(map(int, open(0).read().split()))
print((L[-1] + T - sum(b - a - T for a, b in zip(L, L[1:]) if b - a > T)))

-a, d = T, 0 -for t in L: -    if a < t: -        d += t - a -    a = t + T -print((a - d)) +print((L[-1] + T - sum(b - a - T for a, b in zip(L, L[1:]) if b - a > T)))