## Total Destruction

View as PDF

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

PeterWang needs help with virus extermination! There are viruses which are in capsules numbered from to , however not all capsules have a virus in them. PeterWang has an extermination ray that can exterminate capsules in the range (This includes ones that contain a virus and ones that do not). However, he can only use the ray up to times.

Since capsules are quite expensive, can you tell PeterWang what is the minimum number of capsules that he has to destroy to exterminate the virus?

#### Input Specification

First line, 3 integers , , , denoting the number of capsules, maximum number of times PeterWang can use the ray, and the number of viruses, respectively.

Next lines, the capsule number , denoting where the virus resides in .

#### Output Specification

Output one integer, the minimum number of capsules that need to be destroyed in order to exterminate the virus.

10 2 5
3
4
5
7
10

6

#### Sample Explanation

PeterWang can use the ray on capsules and then on capsule , which will result in total capsules destroyed, including the capsules that did not have the virus in them.