import numpy as np

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

t = np.array(input().split(), dtype=int)



dt = np.diff(t)

dt = np.minimum(dt, T)

print((T + dt.sum()))
import sys

input = sys.stdin.buffer.readline

sys.setrecursionlimit(10 ** 7)



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

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



ans = T

for x, y in zip(time[:-1], time[1:]):

    ans += min(T, y - x)

print(ans)
import numpy as np

N, T = list(map(int, input().split()))
t = np.array(input().split(), dtype=int)
dt = np.diff(t)
dt = np.minimum(dt, T)
print((T + dt.sum()))

import sys

input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
N, T = list(map(int, input().split()))
time = list(map(int, input().split()))
ans = T
for x, y in zip(time[:-1], time[1:]):
    ans += min(T, y - x)
print(ans)

-import numpy as np +import sys +input = sys.stdin.buffer.readline +sys.setrecursionlimit(10**7) -t = np.array(input().split(), dtype=int) -dt = np.diff(t) -dt = np.minimum(dt, T) -print((T + dt.sum())) +time = list(map(int, input().split())) +ans = T +for x, y in zip(time[:-1], time[1:]): +    ans += min(T, y - x) +print(ans)