#P3984. 高兴的津津

高兴的津津

Description

Jinjin has started high school. Under her mom’s strict training, she became a top OI contestant and wins Au every time. Each time she gets an Au, she becomes happy. Assume Jinjin does not get happy for any other reason, and her happiness lasts for TT days (including the award day). Even if she wins another Au while still happy, her happiness lasts for TT days starting from that new award day; it does not add an extra TT days, unless she wins again later. Please help check Jinjin’s upcoming schedule: she will attend nn contests. How many days in total will Jinjin be happy in the coming days?

Input Format

The first line contains two integers nn and TT.

The next line contains nn strictly increasing integers tit_i, meaning she won an Au on day tit_i.

Output Format

Output a single integer: the total number of days Jinjin is happy.

3 5
1 2 10
11

Hint

Constraints

For 100%100\% of the testdata, it is guaranteed that:

  • 1n2×1051 \le n \le 2 \times 10^5.
  • 1T1091 \le T \le 10^9.
  • 1ti1091 \le t_i \le 10^9, and tit_i is strictly increasing.

Translated by ChatGPT 5