output_description: Assume that the shower will emit water for a total of X seconds. Print X.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N T
      t_1 t_2 ... t_N
attempt: import sys
  
  sys.setrecursionlimit(1 << 25)
  read = sys.stdin.readline
  ra = range
  enu = enumerate
  
  
  def read_ints():
      return list(map(int, read().split()))
  
  
  def read_a_int():
      return int(read())
  
  
  def read_tuple(H):
      """
      H is number of rows
      """
      ret = []
      for _ in range(H):
          ret.append(tuple(map(int, read().split())))
      return ret
  
  
  def read_col(H):
      """
      H is number of rows
      A列、B列が与えられるようなとき
      ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
      """
      ret = []
      for _ in range(H):
          ret.append(list(map(int, read().split())))
      return tuple(map(list, zip(*ret)))
  
  
  def read_matrix(H):
      """
      H is number of rows
      """
      ret = []
      for _ in range(H):
          ret.append(list(map(int, read().split())))
      return ret
      # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため
  
  
  MOD = 10**9 + 7
  INF = 2**31  # 2147483648 > 10**9
  # default import
  from collections import defaultdict, Counter, deque
  from operator import itemgetter
  from itertools import product, permutations, combinations
  from bisect import bisect_left, bisect_right  # , insort_left, insort_right
  
  # https://atcoder.jp/contests/arc073/tasks/arc073_a
  # 愚直でよくね？
  N, T = read_ints()
  t = read_ints()
  
  ans = 0
  # t(i+1)<ti+Tだったら差を足してそうじゃなければTを足すのが良さそう
  for i in range(N - 1):
      if t[i + 1] < t[i] + T:
          ans += t[i + 1] - t[i]
      else:
          ans += T
  ans += T  # 最後の人
  print(ans)
  
problem_description: Statement
  
  In a public bath, there is a shower which emits water for T seconds when the
  switch is pushed.
  
  If the switch is pushed when the shower is already emitting water, from that
  moment it will be emitting water for T seconds. Note that it does not mean
  that the shower emits water for T additional seconds.
  
  N people will push the switch while passing by the shower. The i-th person
  will push the switch t_i seconds after the first person pushes it.
  
  How long will the shower emit water in total?
samples: [{"input": "2 4\n    0 3", "output": "7\n    \n\nThree seconds after the first person pushes the water, the switch is pushed\nagain and the shower emits water for four more seconds, for a total of seven\nseconds.\n\n* * *"}, {"input": "2 4\n    0 5", "output": "8\n    \n\nOne second after the shower stops emission of water triggered by the first\nperson, the switch is pushed again.\n\n* * *"}, {"input": "4 1000000000\n    0 1000 1000000 1000000000", "output": "2000000000\n    \n\n* * *"}, {"input": "1 1\n    0", "output": "1\n    \n\n* * *"}, {"input": "9 10\n    0 3 5 7 100 110 200 300 311", "output": "67"}]