COCI '17 Contest 4 #1 Rasvjeta
View as PDFIt is Advent season. There are  street lights in a street 
 metres long (the metres of the
street are denoted with numbers from 
 to 
). Each of the lights lights up the metre of the
street it's located in and 
 metres to the left and to the right of that location. In other words, if
the light is located at metre 
, it lights up all metres of the street from 
 to 
,
inclusively. Of course, it is possible for a metre of the street to be lit up by multiple street
lights. All lights have distinct locations.
The problem is that there is a possibility that the lights don't light up all  metres of the
street. It is your task to determine the minimal amount of additional lights needed to be put
up (at a position from 
 to 
) so that the entire street is lit up.
Input Specification
The first line of input contains the number  
.
The second line of input contains the number  
.
The third line contains the number  
.
Each of the following  lines contains a number. The numbers are sorted in ascending order
and represent the positions of each of the 
 street lights.
The positions will be distinct and from the interval .
Output Specification
You must output the required number from the task.
Sample Input 1
5
2
2
1
5
Sample Output 1
0
Explanation for Sample Output 1
It's not necessary to add lights to the street, since all  metres are already lit up.
Sample Input 2
26
3
3
3
19
26
Sample Output 2
2
Sample Input 3
13
2
10
1
2
Sample Output 3
1
Explanation for Sample Output 3
It is necessary to add one lamp, for example at location .
Comments