N, T = list(map(int, input().split()))

t = list(map(int, input().split()))

lastOn = t[0]

ans = 0

for i in range(1,N):

    ti = t[i]

    ans += min(T, ti-lastOn)

    lastOn = ti

ans += T

print(ans)

N, T = list(map(int, input().split()))

*t, = list(map(int, input().split()))

ans = 0

last = -10**10

for a in t:

    ans += T - max(last + T - a, 0)

    last = a

print(ans)

N, T = list(map(int, input().split()))
t = list(map(int, input().split()))
lastOn = t[0]
ans = 0
for i in range(1, N):
    ti = t[i]
    ans += min(T, ti - lastOn)
    lastOn = ti
ans += T
print(ans)

N, T = list(map(int, input().split()))
(*t,) = list(map(int, input().split()))
ans = 0
last = -(10**10)
for a in t:
    ans += T - max(last + T - a, 0)
    last = a
print(ans)

-t = list(map(int, input().split())) -lastOn = t[0] +(*t,) = list(map(int, input().split())) -for i in range(1, N): -    ti = t[i] -    ans += min(T, ti - lastOn) -    lastOn = ti -ans += T +last = -(10**10) +for a in t: +    ans += T - max(last + T - a, 0) +    last = a