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