CF54A.Presents

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The Hedgehog likes to give presents to his friend, but no less he likes to receive them.

Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he choose, how large should it be?

In order to get to know this, the Hedgehog asks you to write him a program that will count the estimated number of presents that he will receive during the following NN days. Besides, he is guided by the principle:

  • on each holiday day the Hedgehog will necessarily receive a present,
  • he receives presents at least every KK days (i.e., if he received a present on the ii -th day, he will receive the next present no later than on the i+Ki+K -th day).

For the given NN and KK , as well as the list of holidays among the following NN days count the minimal number of presents that could be given to the Hedgehog. The number of today's day is zero, and you should regard today's present as already given (i.e., you shouldn't count it in the answer).

输入格式

The first line contains integers NN and KK ( 1<=N<=3651<=N<=365 , 1<=K<=N1<=K<=N ).

The second line contains a number CC which represents the number of holidays ( 0<=C<=N0<=C<=N ). Then in the same line follow CC numbers ranging from 11 to NN which are the numbers of holiday days. The numbers are given in the increasing order, without repeating numbers among them.

输出格式

Print a single number — the minimal number of presents the Hedgehog will receive over the following NN days.

输入输出样例

  • 输入#1

    5 2
    1 3
    

    输出#1

    3
  • 输入#2

    10 1
    3 6 7 8
    

    输出#2

    10
首页