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

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

cnt = 0

cur = 0

for i in range(1,N):

    b = A[i]

    a = A[i-1]

    if b-a<T:

        cur += b-a

    else:

        cnt += cur+T

        cur = 0

cnt += cur+T

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

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

cnt = 0

cur = 0

for i in range(1,N):

    if A[i]-A[i-1]>T:

        cnt += A[i-1]-cur+T

        cur = A[i]

cnt += A[N-1]+T-cur

print(cnt)
N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
cnt = 0
cur = 0
for i in range(1, N):
    b = A[i]
    a = A[i - 1]
    if b - a < T:
        cur += b - a
    else:
        cnt += cur + T
        cur = 0
cnt += cur + T
print(cnt)

N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
cnt = 0
cur = 0
for i in range(1, N):
    if A[i] - A[i - 1] > T:
        cnt += A[i - 1] - cur + T
        cur = A[i]
cnt += A[N - 1] + T - cur
print(cnt)

-    b = A[i] -    a = A[i - 1] -    if b - a < T: -        cur += b - a -    else: -        cnt += cur + T -        cur = 0 -cnt += cur + T +    if A[i] - A[i - 1] > T: +        cnt += A[i - 1] - cur + T +        cur = A[i] +cnt += A[N - 1] + T - cur