시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 133 47 37 37.000%

문제

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

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