# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
161890 | boolodifjenula | Rasvjeta (COCI17_rasvjeta) | Cpython 3 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
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 s and k:
s+=1
print(s)