시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 266 104 77 38.119%

문제

우리는 새로운 소변기 모델을 개발했다. 이 소변기에는 감지 센서가 있고 "플러시" 기능이 있다. 우리는 아직 이 소변기의 소프트웨어는 가지고 있지 않기 때문에 언제 플러시를 할 것인지 계산하는 프로그램이 필요하다. 규칙은 다음과 같다.

  • 어떤 사람이 K초 이상의 시간 동안 계속 소변기 앞에 서 있으면, 센서는 이 소변기를 "사용중"이라고 기록한다.
  • 소변기가 "사용중"이라고 기록된 시점으로부터 L초 동안 소변기 앞에 서있는 사람이 없다면, 센서는 이 소변기를 "완료"라고 기록한다. 이때 플러시 기능이 활성화된다.
문제에서 주어진 시간 외에는 소변기 앞에 사람이 서있지 않다.

입력

입력의 첫 번째 줄은 세 정수 K, L, N (1 ≤ K, L ≤ 1000, 1 ≤ N ≤ 10,000)이 있다.

두 번째 줄은 0과 1로 이루어진 길이 N의 수열이 주어진다. 이것은 주어진 시간에 센서가 기록하는 데이터를 나타낸다. 0은 그 시간에 소변기 앞에 서있는 사람이 없다는 의미이고, 1은 누군가 소변기 앞에 서있다는 뜻이다.

출력

소변기가 플러시를 할 때마다 시작 시간을 기준으로의 시간을 출력한다. 시간은 오름차순으로 정렬되어 있어야 하며, 각 줄에 하나씩 출력한다.

만일 소변기가 플러시를 하지 않으면, 'NIKAD'를 따옴표 없이 출력한다.

예제 입력 1

1 1 3
101

예제 출력 1

2
4

예제 입력 2

3 1000 3
111

예제 출력 2

1003

예제 입력 3

3 2 18
011101001101110001

예제 출력 3

8
16
W3sicHJvYmxlbV9pZCI6IjMxODYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMxOGNcdWJjYzBcdWFlMzAiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzZiMFx1YjlhY1x1YjI5NCBcdWMwYzhcdWI4NWNcdWM2YjQgXHVjMThjXHViY2MwXHVhZTMwIFx1YmFhOFx1YjM3OFx1Yzc0NCBcdWF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