P3984 Happy Jinjin
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 $T$ days (including the award day). Even if she wins another Au while still happy, her happiness lasts for $T$ days starting from that new award day; it does not add an extra $T$ days, unless she wins again later. Please help check Jinjin’s upcoming schedule: she will attend $n$ contests. How many days in total will Jinjin be happy in the coming days?
Input Format
The first line contains two integers $n$ and $T$.
The next line contains $n$ strictly increasing integers $t_i$, meaning she won an Au on day $t_i$.
Output Format
Output a single integer: the total number of days Jinjin is happy.
Explanation/Hint
#### Constraints
For $100\%$ of the testdata, it is guaranteed that:
- $1 \le n \le 2 \times 10^5$.
- $1 \le T \le 10^9$.
- $1 \le t_i \le 10^9$, and $t_i$ is strictly increasing.
Translated by ChatGPT 5