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

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

i=1

now=T

ans=T

while i<n:

    if t[i]+T<now:

        while t[i]+T<now:

            i+=1

    if t[i]>=now:

        now=t[i]+T

        ans+=T

        i+=1

    elif t[i]+T>=now:

        ans+=t[i]+T-now

        now=t[i]+T

        i+=1

print(ans)

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

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

ans=0

now=0

for i in range(n):

    if t[i]<=now:

        ans+=t[i]+T-now

        now=t[i]+T

    else:

        ans+=T

        now=t[i]+T

print(ans)
n, T = list(map(int, input().split()))
t = list(map(int, input().split()))
i = 1
now = T
ans = T
while i < n:
    if t[i] + T < now:
        while t[i] + T < now:
            i += 1
    if t[i] >= now:
        now = t[i] + T
        ans += T
        i += 1
    elif t[i] + T >= now:
        ans += t[i] + T - now
        now = t[i] + T
        i += 1
print(ans)

n, T = list(map(int, input().split()))
t = list(map(int, input().split()))
ans = 0
now = 0
for i in range(n):
    if t[i] <= now:
        ans += t[i] + T - now
        now = t[i] + T
    else:
        ans += T
        now = t[i] + T
print(ans)

-i = 1 -now = T -ans = T -while i < n: -    if t[i] + T < now: -        while t[i] + T < now: -            i += 1 -    if t[i] >= now: -        now = t[i] + T -        ans += T -        i += 1 -    elif t[i] + T >= now: +ans = 0 +now = 0 +for i in range(n): +    if t[i] <= now: -        i += 1 +    else: +        ans += T +        now = t[i] + T