# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
161891 | 2019-11-05T08:10:26 Z | boolodifjenula | Rasvjeta (COCI17_rasvjeta) | Python 3 | 0 ms | 0 KB |
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)