P5613 [MtOI2019] Too Many Black Mosquitoes

Description

There are $n(1\leq n\leq 1000)$ steps in front of Hikari. Every $1s$, she can jump upward by $m(1\leq m\leq n)$ steps (she does not stop on the steps in between). There are $k(k\leq 10)$ special platforms $a_i$ on the steps. When Hikari **stops** on such a platform, $m$ increases by $1$. Ask for the time Hikari spends to reach the top of the steps.

Input Format

There are $2$ lines in total. The first line contains $3$ non-negative integers $n, m, k$. The second line contains $k$ positive integers. The $i$-th positive integer is $a_i$. It is guaranteed that the input $a_i$ are strictly increasing.

Output Format

There is $1$ line in total. Output $1$ positive integer, the time spent.

Explanation/Hint

### Subtasks For $60\%$ of the testdata, $k = 0$. For $100\%$ of the testdata, $1\leq m\leq n\leq 1000$, $k\leq 10$. ### Source [MtOI2019 Extra Round](https://www.luogu.org/contest/22614) T1 Problem setter: disangan233. Translated by ChatGPT 5