P29021 [洛谷] [MtOI2019] Black Mosquitoes
普及-
题目描述

Problem Description

Hikari is facing a staircase with \( n \) ( \( 1 \leq n \leq 1000 \) ) steps. Every second, she can jump up \( m \) ( \( 1 \leq m \leq n \) ) steps. (She does not stop on intermediate steps)

There are \( k \) ( \( k \leq 10 \) ) special platforms \( a_i \) on the steps. When Hikari stays on these platforms, \( m \) increases by 1.

Calculate the time Hikari spends to reach the top of the staircase.

Input Format

There are 2 lines in the input.

The first line contains 3 non-negative integers \( n \), \( m \), and \( k \).

The second line contains \( k \) positive integers, where the \( i \)-th integer represents \( a_i \). The input guarantees that \( a_i \) is monotonically increasing.

Output Format

There is 1 line in the output, containing a single positive integer representing the time spent.

Sample Input and Output

Sample Input #1

10 5 0

Sample Output #1

2

Sample Input #2

31 4 2
8 13

Sample Output #2

6

Notes

Subtasks

For 60% of the data, \( k = 0 \).

For 100% of the data, \( 1 \leq m \leq n \leq 1000 \), \( k \leq 10 \).

Problem Source

MtOI2019 Extra Round T1

Problem Author: disangan233

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
10 5 0
样例输出
2