시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 128 44 34 35.789%

문제

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

  • 어떤 사람이 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
W3sicHJvYmxlbV9pZCI6IjMxODYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMxOGNcdWJjYzBcdWFlMzAiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzZiMFx1YjlhY1x1YjI5NCBcdWMwYzhcdWI4NWNcdWM2YjQgXHVjMThjXHViY2MwXHVhZTMwIFx1YmFhOFx1YjM3OFx1Yzc0NCBcdW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