pisoar | 프로그래밍의 벗 PivotOJ
PivotOJ

pisoar

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2005 Regional Competition - SeniorsBOJ 3186

문제

We have a new model of a modern urinal equipped with an optical sensor and a "flush" function. We don't have software for it, so we have to write a program that will calculate all the moments when it is time for flushing. The rules are:

  • sensors mark that urinal is being used if someone is standing in front of the urinal for K or more consecutive seconds,
  • sensors mark that urinal use has completed when nobody is standing in front of the urinal for L consecutive seconds, starting from a point where the sensors marked that the urinal is being used (according to the first rule); in that moment, flushing is activated.

Before and after given time interval, we consider that nobody is standing in front of the urinal.

입력

First line of input contains three integers, K, L and N, 1 ≤ K, L ≤ 1000, 1 ≤ N ≤ 10,000.

Second line contains a sequence of N digits - zeros and ones. They are representing data received by sensors for a given time interval. Each digit tells us state of sensor in one second. Zero means that nobody was in front of the urinal during that second, and one means that somebody was in front of the urinal.

출력

For each flushing, write the corresponding activation time in seconds counting from the beginning of the interval. These numbers must be sorted in ascending order, and written in consecutive lines.

If the toilet is never flushed, then just output the word 'NIKAD'.

예제

예제 1

입력
1 1 3
101
출력
2
4

예제 2

입력
3 1000 3
111
출력
1003

예제 3

입력
3 2 18
011101001101110001
출력
8
16
코드를 제출하려면 로그인하세요.