#P5613. [MtOI2019] 黑蚊子多
[MtOI2019] 黑蚊子多
Description
There are steps in front of Hikari. Every , she can jump upward by steps (she does not stop on the steps in between).
There are special platforms on the steps. When Hikari stops on such a platform, increases by .
Ask for the time Hikari spends to reach the top of the steps.
Input Format
There are lines in total.
The first line contains non-negative integers .
The second line contains positive integers. The -th positive integer is . It is guaranteed that the input are strictly increasing.
Output Format
There is line in total. Output positive integer, the time spent.
10 5 0
2
31 4 2
8 13
6
Hint
Subtasks
For of the testdata, .
For of the testdata, , .
Source
Problem setter: disangan233.
Translated by ChatGPT 5
京公网安备 11011102002149号