Submit solution
Points:
7
Time limit:
0.6s
Memory limit:
256M
Problem type
Allowed languages
C, C#, C++, Java, Python
Your street has houses, conveniently numbered from
to
. Out of these
houses,
of them have security installed. Mindful of gaps in coverage, the Neighborhood Watch would like to ensure that every set of
consecutive houses has at least two different houses with cameras. What is the minimum number of additional cameras necessary to achieve this?
Input
The first line of input contains three integers,
,
, and
.
The next lines of input contain the distinct locations of the existing cameras.
Output
Print, on a single line, a single integer indicating the minimum number of cameras that need to be added.
Sample Input
15 5 4
2
5
7
10
13
Sample Output
3
Comments