N=int(input())
M=int(input())
K=int(input())
O=[i+1 for i in range (N)]
for i in range(M):
P=int(input())
for i in range(P-K-1,P+K):
if -1<i<len(O):
O[i]=0
k=0
p=0
s=0
for i in range(N):
if O[i]:
k+=1
elif k:
p+=1
if k and k+p==K+1:
s+=1
k=-K
p=-K
if i==N-1 and k:
s+=1
print(s)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
26 ms |
3360 KB |
Output isn't correct |
2 |
Incorrect |
25 ms |
3300 KB |
Output isn't correct |
3 |
Correct |
28 ms |
3428 KB |
Output is correct |
4 |
Incorrect |
64 ms |
3356 KB |
Output isn't correct |
5 |
Incorrect |
28 ms |
3360 KB |
Output isn't correct |
6 |
Incorrect |
31 ms |
3356 KB |
Output isn't correct |
7 |
Incorrect |
27 ms |
3352 KB |
Output isn't correct |
8 |
Correct |
34 ms |
3300 KB |
Output is correct |
9 |
Correct |
35 ms |
3364 KB |
Output is correct |
10 |
Correct |
28 ms |
3360 KB |
Output is correct |