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: from functools import reduce
  import math
  
  
  def main():
      # 文字列の2進数を数値にする
      # '101' → '5'
      # 文字列の頭に'0b'をつけてint()にわたす
      # binary = int('0b'+'101',0)
  
      # 2進数で立っているbitを数える
      # 101(0x5) → 2
      # cnt_bit = bin(5).count('1')
  
      # N! を求める
      # f = math.factorial(N)
  
      # 切り捨て
      # 4 // 3
      # 切り上げ
      # -(-4 // 3)
  
      # 初期値用:十分大きい数(100億)
      # 1e10
  
      # 初期値用:十分小さい数(-100億)
      # -1e10
  
      # 1文字のみを読み込み
      # 入力:2
      # a = input().rstrip()
      # 変数:a='2'
  
      # スペース区切りで標準入力を配列として読み込み
      # 入力:2 4 5 7
      # a, b, c, d = (int(_) for _ in input().split())
      # 変数:a=2 b=4 c=5 d =7
  
      # 1文字ずつ標準入力を配列として読み込み
      # 入力:2 4 5 7
      # a = list(int(_) for _ in input().split())
      # 変数:a = [2, 4, 5, 7]
  
      # 1文字ずつ標準入力を配列として読み込み
      # 入力:2457
      # a = list(int(_) for _ in input())
      # 変数:a = [2, 4, 5, 7]
      N, T = (int(_) for _ in input().split())
      t = list(int(_) for _ in input().split())
      sum = T
      stop_time = T
      for i in range(1, N):
          if stop_time > t[i]:
              sum -= stop_time - t[i]
              stop_time = t[i] + T
          elif stop_time < t[i]:
              stop_time = t[i] + T
          sum += T
      print(sum)
  
  
  if __name__ == "__main__":
      main()
  
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"}]