viruses which are in capsules numbered from to , however not all capsules have a virus in them. 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.
needs help with virus extermination! There areSince capsules are quite expensive, can you tell
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 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.
Subtasks
For all subtasks:
Subtask 1 [30%]
Subtask 2 [70%]
No additional constraints.
Sample Input
10 2 5
3
4
5
7
10
Sample Output
6
Sample Explanation
and then on capsule , which will result in total capsules destroyed, including the capsules that did not have the virus in them.
can use the ray on capsules
Comments