TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
N, K, C = map(int,input().split())
S = list(input())

A = list()
B = list()

i = 0
num = 0
while num < K:
  if S[i] == "o":
    A.append(i)
    num += 1
    i += C
  i += 1
i = len(S)-1
num = 0
while num < K:
  if S[i] == "o":
    B.append(i)
    num+=1
    i -= C
  i -= 1
B.sort()

print(A)
print(B)

for i,j in zip(A,B):
  if i == j:
    print(i+1)

N, K, C = map(int,input().split())
S = list(input())

A = list()
B = list()

i = 0
num = 0
while num < K:
  if S[i] == "o":
    A.append(i)
    num += 1
    i += C
  i += 1
i = len(S)-1
num = 0
while num < K:
  if S[i] == "o":
    B.append(i)
    num+=1
    i -= C
  i -= 1
B.sort()

for i,j in zip(A,B):
  if i == j:
    print(i+1)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
n,k,c= map(int,input().split())
s = input()
i = 0

def func(s,k,c):
  i = 0
  res = []
  while 1:
    if s[i] == 'o':
      res.append(i)
      if len(ans1)== k:
        break
      i += c
  return res
ans1 = set(func(s,k,c))
ans2 = set(func(s[::-1],k,c))

ans = list(ans1.intersection(ans2))
for a in ans:
  print(a)

n,k,c= map(int,input().split())
s = input()
i = 0

def func(s,k,c):
  i = 0
  res = []
  while 1:
    if s[i] == 'o':
      res.append(i)
      if len(res)== k:
        break
      i += c
    i+= 1
  return res
ans1 = set(func(s,k,c))
ans2 = set(func(s[::-1],k,c))

ans = list(ans1.intersection(ans2))
for a in ans:
  print(a+1)



n,k,c= map(int,input().split())
s = input()
i = 0

def func(s,k,c):
  i = 0
  res = []
  while 1:
    if s[i] == 'o':
      res.append(i)
      if len(res)== k:
        break
      i += c
    i+= 1
  return res
ans1 = func(s,k,c)
ans2 = func(s[::-1],k,c)
ans2 = [n-a-1 for a in ans2]
ans2 = ans2[::-1]

for i in range(k):
  if ans1[i]==ans2[i]:
    print(ans1[i]+1)




Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
def main():
    from itertools import groupby
    n, k, c = map(int, input().split())
    s = list(input())

    if c == 0:
        if s.count('o') == k:
            ans = '\n'.join(map(str,range(1,n+1)))
            print(ans)
            return
        else:
            return

       check_f = []
    x = 0
    for i, j in enumerate(s, 1):
        if x:
            x -= 1
            continue
        if j == 'o':
            x = c
            check_f.append(i)
        if len(check_f) == k:
            break

    check_b = []
    x = 0
    for i, j in enumerate(s[::-1]):
        if x:
            x -= 1
            continue
        if j == 'o':
            x = c
            check_b.append(n - i)
        if len(check_b) == k:
            break

    ans = list(set(check_f) & set(check_b))
    ans.sort()
    ans = '\n'.join(map(str,ans))
    print(ans)

if __name__ == '__main__':
    main()


def main():
    from itertools import groupby
    n, k, c = map(int, input().split())
    s = list(input())

    if c == 0:
        a = [i + 1 for i, c in enumerate(s) if c == 'o']
        if len(a) == k:
            print(*a, sep='\n')
        else:
            print()
        exit()

    check_f = []
    x = 0
    for i, j in enumerate(s, 1):
        if x:
            x -= 1
            continue
        if j == 'o':
            x = c
            check_f.append(i)
        if len(check_f) == k:
            break

    check_b = []
    x = 0
    for i, j in enumerate(s[::-1]):
        if x:
            x -= 1
            continue
        if j == 'o':
            x = c
            check_b.append(n - i)
        if len(check_b) == k:
            break

    ans = list(set(check_f) & set(check_b))
    ans.sort()
    ans = '\n'.join(map(str, ans))
    print(ans)


if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
n,k,c=map(int,input().split())
s=input()
l=len(s)
cand=[]
for i in range(l):
  if s[i]=='o':
    cand.append(i+1)
cnt1=[0]*(n+2)
cnt2=[0]*(n+2)
prev=0
cnt=0
for i in range(l):
  if s[i]=='o' and i>=prev:
    cnt+=1
    cnt1[i+1]=cnt
    prev=i+(c+1)
  else:
    cnt1[i+1]=cnt
prev=l
cnt=0
for i in range(l-1,-1,-1):
  if s[i]=='o' and i<=prev:
    cnt+=1
    cnt2[i+1]=cnt
    prev=i-(c+1)
  else:
    cnt2[i+1]=cnt
ans=[]
for i in range(len(cand)):
  tmp=cand[i]
  if cnt1[tmp-1]+cnt2[tmp+1]<k:
    ans.append(tmp)
print(ans)

n,k,c=map(int,input().split())
s=input()
l=len(s)
cand=[]
for i in range(l):
  if s[i]=='o':
    cand.append(i+1)
cnt1=[0]*(n+2)
cnt2=[0]*(n+2)
prev=0
cnt=0
for i in range(l):
  if s[i]=='o' and i>prev+c:
    cnt+=1
    cnt1[i+1]=cnt
    prev=i
  else:
    cnt1[i+1]=cnt
prev=l
cnt=0
for i in range(l-1,-1,-1):
  if s[i]=='o' and i<prev-c:
    cnt+=1
    cnt2[i+1]=cnt
    prev=i
  else:
    cnt2[i+1]=cnt
ans=[]
for i in range(len(cand)):
  tmp=cand[i]
  if cnt1[tmp-1]+cnt2[tmp+1]<k:
    ans.append(tmp)
for val in ans:
  print(val)

n,k,c=map(int,input().split())
s=input()
l=len(s)
cand=[]
for i in range(l):
  if s[i]=='o':
    cand.append(i+1)
cnt1=[0]*(n+2)
cnt2=[0]*(n+2)
prev=0
cnt=0
for i in range(l):
  if s[i]=='o' and i>=prev:
    cnt+=1
    cnt1[i+1]=cnt
    prev=i+(c+1)
  else:
    cnt1[i+1]=cnt
prev=l
cnt=0
for i in range(l-1,-1,-1):
  if s[i]=='o' and i<=prev:
    cnt+=1
    cnt2[i+1]=cnt
    prev=i-(c+1)
  else:
    cnt2[i+1]=cnt
ans=[]
for i in range(len(cand)):
  tmp=cand[i]
  if cnt1[tmp-1]+cnt2[tmp+1]<k:
    ans.append(tmp)
for val in ans:
  print(val)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
n, k, c = map(int, input().split())
s = input()

l, r = [], []
cur = 0
count = 0

while cur <= n:
    if s[cur] == "o":
        count += 1
        l.append((count, cur+1))
        cur += c

    cur += 1

cur = n
count = k

while cur >= 0:
    if s[cur] == "o":
        r.append((count, cur+1))
        count -= 1
        cur -= c

    cur -= 1

ans = (i[1] for i in set(l) & set(r))
for i in sorted(ans):
    print(i)

from sys import stdin
def main():
    input = stdin.readline
    n, k, c = map(int, input().split())
    s = input()

    ans = ""
    for i in range(n):
        if s[i] == "x":
            continue

        cur = 0
        count = 0
        ss = s[cur]

        while cur < n:
            if ss == "o" and cur != i:
                count += 1
                cur += c

            cur += 1

            if count >= k:
                break

        if count < k:
            ans+=str(i+1)+"\n"

    print(ans)

if __name__ == '__main__':
    main()

n, k, c = map(int, input().split())
s = input() + "?"

l, r = [], []
cur = 0
count = 0

while cur <= n:
    if s[cur] == "o":
        count += 1
        l.append((count, cur+1))
        cur += c

    cur += 1

cur = n
count = k

while cur >= 0:
    if s[cur] == "o":
        r.append((count, cur+1))
        count -= 1
        cur -= c

    cur -= 1

ans = (i[1] for i in set(l) & set(r))
for i in sorted(ans):
    print(i)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
N,K,C=map(int,input().split())
S=input()

l=[]
la=[]
i=0
c=0
while True:
    if S[i]=="o":
        l.append(i)
        i+=C
        c+=1
    i+=1

if c>K:
    exit()

i=N-1
c=0

while True:
    if S[i]=="o":
        la.append(i)
        i-=C
        c+=1
    i-=1
    if c==K:
        break
    
for i in l:
    if i in la:
        print(i+1)

N,K,C=map(int,input().split())
S=input()

l=[0]*N
la=[0]*N
i=0
c=0
while True:
    if S[i]=="o":
        l[i]=1
        i+=C
        c+=1
    i+=1
    if i>=N:
        break

if c>K:
    exit()

i=N-1
c=0

while True:
    if S[i]=="o":
        la[i]=1
        i-=C
        c+=1
    i-=1
    if c==K:
        break
    
for i in range(N):
    if l[i]==1 and la[i]==1:
        print(i+1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
k,y,c = map( int, input().split(" "))
ss = input()

asc = []
dsc = []

cnt = 0
err_flg = 0
while( True ):
  if(len(ss) <= cnt):
    err_flg = 1
    break
  if( ss[cnt] == "o"):
    asc.append( cnt )
    cnt += c+1
  else:
    cnt += 1
    
  if( len(asc)==y ):
    break

cnt = 0
ss = ss[::-1]
while( True ):
  if(len(ss) <= cnt):
    err_flg = 1
    break
  if( ss[cnt] == "o"):
    dsc.append( cnt )
    cnt += c+1
  else:
    cnt += 1
    
  if( len(dsc)==y ):
    break
    
for i in range(len(dsc)):
  dsc[i] = len(ss) - dsc[i] - 1
  
dsc.reverse()
print(asc)
print(dsc)

if( err_flg == 0 ):
  for i in range(len(asc)):
    if( asc[i] == dsc[i] ):
      print(asc[i])
    
  

k,y,c = map( int, input().split(" "))
ss = input()

asc = []
dsc = []

cnt = 0
err_flg = 0
while( True ):
  if(len(ss) <= cnt):
    err_flg = 1
    break
  if( ss[cnt] == "o"):
    asc.append( cnt )
    cnt += c+1
  else:
    cnt += 1
    
  if( len(asc)==y ):
    break

cnt = 0
ss = ss[::-1]
while( True ):
  if(len(ss) <= cnt):
    err_flg = 1
    break
  if( ss[cnt] == "o"):
    dsc.append( cnt )
    cnt += c+1
  else:
    cnt += 1
    
  if( len(dsc)==y ):
    break
    
for i in range(len(dsc)):
  dsc[i] = len(ss) - dsc[i] - 1
  
dsc.reverse()
#print(asc)
#print(dsc)

if( err_flg == 0 ):
  for i in range(len(asc)):
    if( asc[i] == dsc[i] ):
      print(asc[i])
    
  

k,y,c = map( int, input().split(" "))
ss = input()

asc = []
dsc = []

cnt = 0
err_flg = 0
while( True ):
  if(len(ss) <= cnt):
    err_flg = 1
    break
  if( ss[cnt] == "o"):
    asc.append( cnt )
    cnt += c+1
  else:
    cnt += 1
    
  if( len(asc)==y ):
    break

cnt = 0
ss = ss[::-1]
while( True ):
  if(len(ss) <= cnt):
    err_flg = 1
    break
  if( ss[cnt] == "o"):
    dsc.append( cnt )
    cnt += c+1
  else:
    cnt += 1
    
  if( len(dsc)==y ):
    break
    
for i in range(len(dsc)):
  dsc[i] = len(ss) - dsc[i] - 1
  
dsc.reverse()
#print(asc)
#print(dsc)

if( err_flg == 0 ):
  for i in range(len(asc)):
    if( asc[i] == dsc[i] ):
      print(asc[i]+1)
    
  

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
exit()

n,k,c=map(int,input().split())
s=input()
l=list();r=list()
nex=0
for i in range(n):
	if i<nex:
		continue
	if s[i]=="o":
		nex=i+c+1
		l.append(i)
		if len(l)==k:
			break
nex=-1
for i in range(n):
	if i<nex:
		continue
	if s[-i-1]=="o":
		nex=i+c+1
		r.append(n-i-1)
		if len(r)==k:
			break
r=r[::-1]
for i in range(k):
	if l[i]==r[i]:
		print(l[i]+1)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
print('')

N, K, C = map(int, input().split())
S = input()

def calc(S):
    now = 1
    ret = [0] * (N + 1)
    while now <= N:
        if S[now] == 'x':
            now += 1
            continue
        ret[now] += 1
        now += C + 1
    for i in range(N):
        ret[i + 1] += ret[i]

    return ret

L = calc('-' + S)
R = calc('-' + S[::-1])[::-1]

ans = []
for mid in range(1, N + 1):
    if S[mid - 1] == 'o' and L[mid] != L[mid - 1] and R[mid] != R[mid - 1] and L[mid] + R[mid] == K:
        ans.append(mid)

print(*ans, sep='\n')

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
N, K, C = map(int, input().split())
S = list(input())
S_work = []
s = []
f = []
i = 0
while len(s) < K:
  if S[i] == "o":
    s.append(i)
    i += C + 1
  elif S[i] == "x":
    i += 1
  elif i == len(S):
    break
i = 1
while len(f) < K:
  if S[N - i] == "o":
    f.append(i)
    i += C + 1
  elif S[N - i] == "x":
    i += 1
  elif i == len(S):
    break

for i in range(K):
  if s[i] == f[i]:
    print(s[i] + 1)

N, K, C = map(int, input().split())
S = list(input())
S_work = []
s = []
f = []
i = 0
while len(s) < K:
  if S[i] == "o":
    s.append(i)
    i += C + 1
  elif S[i] == "x":
    i += 1
  elif i == len(S):
    break
i = 1
while len(f) < K:
  if S[N - i] == "o":
    f.append(i)
    i += C + 1
  elif S[N - i] == "x":
    i += 1
  elif i == len(S):
    break

for i in range(K):
  if s[i] == f[-i-1]:
    print(s[i] + 1)

N, K, C = map(int, input().split())
S = list(input())
S_work = []
s = []
f = []
i = 0
while len(s) < K:
  if S[i] == "o":
    s.append(i)
    i += C + 1
  elif S[i] == "x":
    i += 1
  elif i == len(S):
    break
i = 1
while len(f) < K:
  if S[N - i] == "o":
    f.append(N - i)
    i += C + 1
  elif S[N - i] == "x":
    i += 1
  elif i == len(S):
    break
f.sort()
for i in range(K):
  if s[i] == f[i]:
    print(s[i] + 1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
for i in range(N):
    if s[i]=='o':
        si=copy.copy(s)
        si[i]='x'
        day=N
        count=0
        flag=False
        while day>K-1 and count<K:
            if si[day-1]=='x':
                day-=1
            else:
                count+=1
                day-=C+1
                if count==K:
                    flag=True
        if flag==False:
            print(i+1)


# -*- coding: utf-8 -*-

import numpy as np
N, K, C=map(int, input().split())
s=list(input())

forward=np.zeros(K)
back=np.zeros(K)

day=0
count=0
while day <N and count<K:
    if s[day]=='o':
        forward[count]=day
        count+=1
        day+=C+1
    else:
        day+=1

day=N-1
count=0
while day<N and count<K:
    if s[day]=='o':
        back[count]=day
        count+=1
        day-=C+1
    else:
        day-=1

#print(forward)
#print(back[::-1])

for i in range(K):
    if forward[i]==back[K-1-i]:
        print(int(forward[i])+1)



Verdicts: Runtime Error

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
N,K,C = map(int,input().split())
S = str(input())
works1 = 0
works2 = 0
l1 = []
l2 = []
for i in range(N):
  if S[i] == 'o':
    works1 += 1
    l1.append(i+1)
    i += C-1
  if works1 == K:
    break

for i in range(N):
  if S[-i-1] == 'o':
    works2 += 1
    l2.append(N-i)
    i += C-1
  if works2 == K:
    break

l1.extend(l2)
l = [x for x in set(l1) if l1.count(x) > 1]
for i in range(len(l)):
  print(l)

N,K,C = map(int,input().split())
S = str(input())
works1 = 0
works2 = 0
l1 = []
l2 = []
i = 0
while i < N and works1 < K:
  if S[i] == "o":
    l1.append(i+1)
    i = i+C+1
    works1 += 1
  else:
    i = i+1
i = N-1
while i > -1 and works2 < K:
    if S[i] == "o":
      l2.append(i+1)
      i = i-C-1
      works2 = works2+1
    else:
      i = i-1

for i in range(len(l1)):
  if l1[i] == l2[-i-1] :
    print(l1[i])

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
c = int(line1[2])
s = list(input())
l = [s.index("o") + 1]
r = [len(s) - s[::-1].index("o")]
for i in range(1, k):
  j = l[i - 1]
  m = r[i - 1]
  while j - l[i - 1] <= c or s[j - 1] != "o":
    j += 1
  while r[i - 1] - m <= c or s[m - 1] != "o":
    m -= 1
  r.append(m)
  l.append(j)
for i in range(len(r)):
  if r[i] == l[i]:
    print(i)

line1 = input().split()
n = int(line1[0])
k = int(line1[1])
c = int(line1[2])
s = list(input())
l = [s.index("o") + 1]
r = [len(s) - s[::-1].index("o")]
for i in range(1, k):
  j = l[i - 1]
  m = r[i - 1]
  while j - l[i - 1] <= c or s[j - 1] != "o":
    j += 1
  while r[i - 1] - m <= c or s[m - 1] != "o":
    m -= 1
  r.append(m)
  l.append(j)
r = r[::-1]
for i in range(len(r)):
  if r[i] == l[i]:
    print(r[i])

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]
i=0
while i < n:
    
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1
    


days=[]

for i in range(k):
    
    if L[i]==R[i]:
        days.append(L[i])

for i in range(len(days)):
    print(days[i])

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=c
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=c
    i+=1
print(L,R)

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=c
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=c
    i+=1
    
days=[]
for i in range(k):
    if L[i]==R[k-i-1]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
L=[]
R=[]
N,K,C=map(int,input().split())
S=list(input())
s=S[::-1]
i=0
while len(L)<K:
    if S[i]=='o':
        L.append(i+1)
        if i+C<N:
            for j in range(1,C+1):
                S[i+j]='x'
    i+=1
print(L)
k=0
while len(R)<K:
    if s[k]=='o':
        R.append(N-k)
        if k+C<N:
            for l in range(1,C+1):
                s[k+l]='x'
    k+=1
R=R[::-1]
ans=[]
for i in range(K):
    if L[i]==R[i]:
        ans.append(L[i])
print(*ans)

L=[]
R=[]
N,K,C=map(int,input().split())
S=list(input())
s=S[::-1]
i=0
while len(L)<K:
    if S[i]=='o':
        L.append(i+1)
        if i+C<N:
            for j in range(1,C+1):
                S[i+j]='x'
    i+=1
k=0
while len(R)<K:
    if s[k]=='o':
        R.append(N-k)
        if k+C<N:
            for l in range(1,C+1):
                s[k+l]='x'
    k+=1
R=R[::-1]
ans=[]
for i in range(K):
    if L[i]==R[i]:
        ans.append(L[i])
print(*ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
N, K, C = map(int, input().split())
S = input()
L = []
R = []
L_index = 0
L_count = 0
R_index = N - 1
R_count = K - 1

while L_index < N and L_count < K:
    if S[L_index] == "o":
        L.append(L_index)
        L_index += (C + 1)
        L_count += 1
    else:
        L_index += 1
while R_index >= 0 and R_count >= 0:
    if S[R_index] == "o":
        R.append(R_index)
        R_index -= (C - 1)
        R_count -= 1
    else:
        R_index -= 1

work_day = set(L) & set(R)
for w_day in work_day:
    print(w_day + 1)


n, k, c = map(int, input().split())
s = input()
l = [-1] * k
r = [-1] * k
nowl = 0
indl = 0
while nowl < n and indl < k:
    for i in range(nowl, n):
        if s[i] == "o":
            l[indl] = i
            nowl = i + c + 1
            indl += 1
            break
nowr = n - 1
indr = k - 1
while nowr >= 0 and indr >= 0:
    for i in range(nowr, -1, -1):
        if s[i] == "o":
            r[indr] = i
            nowr = i - c - 1
            indr -= 1
            break
print(l)
print(r)
for i in range(k):
    if l[i] == r[i]:
        print(l[i] + 1)


N, K, C = map(int, input().split())
S = input()
L = [-1] * K
R = [-1] * K
L_index = 0
L_count = 0
R_index = N - 1
R_count = K - 1

while L_index < N and L_count < K:
    if S[L_index] == "o":
        L[L_count] = L_index
        L_index += (C + 1)
        L_count += 1
    else:
        L_index += 1
while R_index >= 0 and R_count >= 0:
    if S[R_index] == "o":
        R[R_count] = R_index
        R_index -= (C + 1)
        R_count -= 1
    else:
        R_index -= 1

for i in range(K):
    if L[i] == R[i]:
        print(L[i] + 1)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
n,k,c=map(int,input().split())
s=input()
ne=10**6*(-1)
fow=[]
bac=[]
for i in range(n):
    if i>ne and s[i]!="x":
        ne=i+c
        fow.append(i)
    if len(fow)==k:
        break
ne=10**6
for i in range(n-1,-1,-1):
    if i<ne and s[i]!="x":
        ne=i-c
        bac.append(i)
    if len(bac)==k:
        break
bac.sort()
for i,j in zip(fow,bac):
    if i==j:
        print(i)

n,k,c=map(int,input().split())
s=input()
ne=10**6*(-1)
fow=[]
bac=[]
for i in range(n):
    if i>ne and s[i]!="x":
        ne=i+c
        fow.append(i)
    if len(fow)==k:
        break
ne=10**6
for i in range(n-1,-1,-1):
    if i<ne and s[i]!="x":
        ne=i-c
        bac.append(i)
    if len(bac)==k:
        break
bac.sort()
for i,j in zip(fow,bac):
    if i==j:
        print(i+1)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
# -*- coding: utf-8 -*-
"""
Created on Sun Apr  5 22:11:18 2020

@author: Kanaru Sato
"""

n,k,c = list(map(int, input().split()))
s = list(input())

early = []
late = []

i = 0
count = 0
while i < n and count < k:
    if s[i] == "o":
        early.append(i)
        i = i+c+1
        count = count+1
    else:
        i = i+1

print(early)

i = n-1
count = 0
while i > -1 and count < k:
    if s[i] == "o":
        late.append(i)
        i = i-c-1
        count = count+1
    else:
        i = i-1

for i in range(len(early)):
    if early[i] == late[k-i-1]:
        print(early[i]+1)

# -*- coding: utf-8 -*-
"""
Created on Sun Apr  5 22:11:18 2020

@author: Kanaru Sato
"""

n,k,c = list(map(int, input().split()))
s = list(input())

early = []
late = []

i = 0
count = 0
while i < n and count < k:
    if s[i] == "o":
        early.append(i)
        i = i+c+1
        count = count+1
    else:
        i = i+1

print(early)

i = n-1
count = 0
while i > -1 and count < k:
    if s[i] == "o":
        late.append(i)
        i = i-c-1
        count = count+1
    else:
        i = i-1

for i in range(len(early)):
    if early[i] == late[k-i-1]:
        print(early[i]+1)

# -*- coding: utf-8 -*-
"""
Created on Sun Apr  5 22:11:18 2020

@author: Kanaru Sato
"""

n,k,c = list(map(int, input().split()))
s = list(input())

early = []
late = []

i = 0
count = 0
while i < n and count < k:
    if s[i] == "o":
        early.append(i)
        i = i+c+1
        count = count+1
    else:
        i = i+1


i = n-1
count = 0
while i > -1 and count < k:
    if s[i] == "o":
        late.append(i)
        i = i-c-1
        count = count+1
    else:
        i = i-1

for i in range(len(early)):
    if early[i] == late[k-i-1]:
        print(early[i]+1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
N,K,C=map(int,input().split())
S=input()
L=[0 for i in range(K)]
R=[0 for i in range(K)]
n=0
rc=0
lc=0
while True:
  if lc==K:
    break
  if S[n]=="o":
    L[lc]=n+1
    n+=C+1
    lc+=1
  else:
    n+=1
n=N-1
while True:
  if rc==K:
    break
  if S[n]=="o":
    R[N-1-rc]=n+1
    n-=C+1
    rc+=1
  else:
    n-=1
for i in range(K):
  if R[i]==L[i]:
    print(R[i])


N,K,C=map(int,input().split())
S=input()
L=[0 for i in range(K)]
R=[0 for i in range(K)]
n=0
rc=0
lc=0
while True:
  if lc==K:
    break
  if S[n]=="o":
    L[lc]=n+1
    n+=C+1
    lc+=1
  else:
    n+=1
n=N-1
while True:
  if rc==K:
    break
  if S[n]=="o":
    R[K-1-rc]=n+1
    n-=C+1
    rc+=1
  else:
    n-=1
for i in range(K):
  if R[i]==L[i]:
    print(R[i])


Verdicts: Runtime Error

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import sys

N,K,C = map(int,input().split())
S = input()
#%%
assign_t = [False]*N
assign_b = [False]*N


for i in range(10):
    nassign_t = [False]*N
    i = 0
    num = 0
    while i<N and num<K:
        if S[i]=='o':
            nassign_t[i] = True
            num += 1
            i += C+1
        else:
            i += 1
    if num==K:
        if i==0:
            for j in range(N):
                assign_t[j] |= nassign_t[j]
        else:
            for j in range(N):
                assign_t[j] &= nassign_t[j]
            
i = N-1
num = 0
while i>=0 and num<K:
    if S[i]=='o':
        assign_b[i]=True
        num += 1
        i -= C+1
    else:
        i -=1


for i in range(N):
    if assign_t[i] and assign_b[i]:
        print(i+1)

# -*- coding: utf-8 -*-
import sys

N,K,C = map(int,input().split())
S = input()
#%%
assign_t = [False]*N
assign_b = [False]*N


for i in range(10):
    nassign_t = [False]*N
    num = 0
    while i<N and num<K:
        if S[i]=='o':
            nassign_t[i] = True
            num += 1
            i += C+1
        else:
            i += 1
    if num==K:
        if i==0:
            for j in range(N):
                assign_t[j] |= nassign_t[j]
        else:
            for j in range(N):
                assign_t[j] &= nassign_t[j]
            
i = N-1
num = 0
while i>=0 and num<K:
    if S[i]=='o':
        assign_b[i]=True
        num += 1
        i -= C+1
    else:
        i -=1


for i in range(N):
    if assign_t[i] and assign_b[i]:
        print(i+1)

# -*- coding: utf-8 -*-
import sys

N,K,C = map(int,input().split())
S = input()
#%%
assign_t = [False]*N
assign_b = [False]*N


i = 0
num = 0
while i<N:
    if S[i]=='o':
        assign_t[i]=True
        num += 1
        i += C+1
    else:
        i += 1

if num>K:
    print()
    sys.exit()

i = N-1
num = 0
while i>=0 and num<K:
    if S[i]=='o':
        assign_b[i]=True
        num += 1
        i -= C+1
    else:
        i -=1


for i in range(N):
    if assign_t[i] and assign_b[i]:
        print(i+1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
import copy

n, k, c = map(int, input().split())
s = list(input())

tmp = copy.deepcopy(s)
wait = 0
last_day = k
count = set()

for num, i in enumerate(tmp):
    if wait>0:
        wait -= 1
        continue
    if i == 'o':
        count.add(num)
        wait = c
        last_day -= 1
        if last_day == 0:
            break

tmp = copy.deepcopy(s)
wait = 0
last_day = k
count2 = set()
for num, i in enumerate(reversed(tmp)):
    if wait>0:
        wait -= 1
    if i == 'o' or i == 'a':
        count2.add(n - num - 1)
        wait = c
        last_day -= 1
        if last_day == 0:
            break

count = list(count)
count2 = list(count2)
count.sort()
count2.sort()
ans = []
for i in range(len(count)):
    if count[i]==count2[i]:
        ans.append(count[i]+1)
        
for i in ans:
    print(i)

import copy

n, k, c = map(int, input().split())
s = list(input())

tmp = copy.deepcopy(s)
wait = 0
last_day = k
count = set()

for num, i in enumerate(tmp):
    if wait>0:
        wait -= 1
        continue
    if i == 'o':
        count.add(num)
        wait = c
        last_day -= 1
        if last_day == 0:
            break

tmp = copy.deepcopy(s)
wait = 0
last_day = k
count2 = set()
for num, i in enumerate(reversed(tmp)):
    if wait>0:
        wait -= 1
        continue
    if i == 'o':
        count2.add(n - num - 1)
        wait = c
        last_day -= 1
        if last_day == 0:
            break

count = list(count)
count2 = list(count2)
count.sort()
count2.sort()
ans = []
for i in range(len(count)):
    if count[i]==count2[i]:
        ans.append(count[i]+1)

for i in ans:
    print(i)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
import itertools
n, k, c = map(int, input().split())
s = input()
counto = s.count("o")
count = 0
a = []
b = [0]
for i in range(n):
    if s[i] == "o":
        a.append(i)
for i in list(itertools.combinations(a, k)):
    for j in range(len(i)-1):
        if i[j] - i[j-1]<=c:
            break
    count += 1
print(count)      

    
    

n, k, c = map(int, input().split())
s = input()
left_dp = []
right_dp = []

i = 0
while len(left_dp)<k:
    if s[i] == "o":
        left_dp.append(i+1)
        i += c+1
    else: i += 1
        
i = n-1
while len(right_dp)<k:
    if s[i] == "o":
        right_dp.append(i+1)
        i -= c+1
    else: i -= 1

for i in range(k):
    if left_dp[i] == right_dp[k-i-1]:
        print(left_dp[i])

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
N,K,C=map(int,input().split())
SL=input()
SR=SL[::-1]
Left=[]
Right=[]
Last=-N
Rast=-N
cL=cR=0
for i in range(N):
    if SL[i]=="o" and i-Last>C and cL<=K:
        Left.append(i)
        Last=i
        cL+=1
    if SR[i]=="o" and i-Rast>C and cR<=K:
        Right.append(N-i-1)
        Rast=i
        cR+=1
Right=Right[::-1]

ans=[]

for k in range(K):
    if Left[k]==Right[k]:
        ans.append(Left[k]+1)
print(ans)

N,K,C=map(int,input().split())
SL=input()
SR=SL[::-1]
Left=[]
Right=[]
Last=-N-1
Rast=-N-1
cL=cR=0
for i in range(N):
    if SL[i]=="o" and i-Last>C and cL<=K:
        Left.append(i)
        Last=i
        cL+=1
    if SR[i]=="o" and i-Rast>C and cR<=K:
        Right.append(N-i-1)
        Rast=i
        cR+=1
Right=Right[::-1]

ans=[]
for k in range(K):
    if Left[k]==Right[k]:
        ans.append(Left[k]+1)

if len(ans)==0:
    print()
else:
    for a in ans:
        print(a)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
N, K, C = map(int, input().split())
S = input()
L, R = [0]*N, [0]*N
i = 0
count = 1
while count <= K:
    if S[i] == 'x':
        i += 1
        continue
    L[i] = count
    count += 1
    i += C+1
i = N-1
count = K
while count > 0:
    if S[i] == 'x':
        i -= 1
        continue
    print(i, count)
    R[i] = count
    count -= 1
    i -= C+1
for i in range(N):
    if L[i] == 0:
        continue
    if L[i] == R[i]:
        print(i+1)

N, K, C = map(int, input().split())
S = input()
L, R = [0]*N, [0]*N
i = 0
count = 1
while count <= K:
    if S[i] == 'x':
        i += 1
        continue
    L[i] = count
    count += 1
    i += C+1
i = N-1
count = K
while count > 0:
    if S[i] == 'x':
        i -= 1
        continue
    R[i] = count
    count -= 1
    i -= C+1
for i in range(N):
    if L[i] == 0:
        continue
    if L[i] == R[i]:
        print(i+1)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
n, k, c = map(int, input().split())
s = input()

cnt = 0
d = c + 1 
no = 0 
f = 0
ans = []
cand = []





for i in range(n):
    if d > c:
        if no == 0 and cand: 
            ans.extend(cand)
            cand = []
        if s[i] == 'o':
            cnt += 1
            d = 0
            no = 0
            cand.append(i+1)
    else:
        if s[i] == 'o':
            no += 1
    d += 1


if no == 0 and cand: 
    ans.extend(cand)


if cnt == k:
    for ansi in ans:
        print(ansi)

n, k, c = map(int, input().split())
s = input()

l = [-c-1]
for i in range(n):
    if s[i] == 'o' and i - l[-1] > c:
        l.append(i)
r = [n + c]
for i in reversed(range(n)):
    if s[i] == 'o' and r[-1] - i > c:
        r.append(i)
r.reverse()


if len(l)-1 == k:
    for li, ri in zip(l[1:], r):
        if li == ri:
            print(li + 1)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
n, k, c = map(int, input().split())
s = list(input())

R = []
p = 0
for _ in range(k):
    R.append(p)
    p += c
    while s[p] == 'x':
        p += 1

L = []
p = n - 1
for _ in range(k):
    L.append(p)
    p -= c
    while s[p] == 'x':
        p -= 1

L = list(reversed(L))

for i in range(k):
    if R[i] == L[i]:
        print(i+1)


n, k, c = map(int, input().split())
s = list(input())

R = []
p = 0
for _ in range(k):
    while s[p] == 'x':
        p += 1
    R.append(p)
    p += c + 1

L = []
p = n - 1
for _ in range(k):
    while s[p] == 'x':
        p -= 1
    L.append(p)
    p -= c + 1

L = list(reversed(L))

for i in range(k):
    if R[i] == L[i]:
        print(R[i] + 1)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
def solve():
  N, K, C = map(int, input().split())
  workable = [i for i, s in enumerate(input()) if s=="o"]
  if len(workable) == K:
    return workable
    
  latest = set()
  prev = workable[-1]+C+1
  for x in reversed(workable):
    if prev - x > C:
      latest.add(x)
      prev = x
      if len(latest) > K:
        return []
  must = []
  prev = -C-1
  for x in workable:
    if x - prev > C:
      if x in latest:
        must.append(x)
      prev = x
  return must

print("\n".join(map(str, solve())))

def with_prev(filt, ad=None):
  prev = None
  def _filt(x):
    nonlocal prev
    if prev is None or filt(x, prev):
      prev = x
      return ad(x) if ad else True
    return False
  return _filt

def solve():
  N, K, C = map(int, input().split())
  workable = [i for i, s in enumerate(input(), 1) if s=="o"]
  
  if len(workable) == K:
    return workable
  
  filt = with_prev(lambda x,p:p-x>C)
  latest = set(filter(filt, reversed(workable)))

  if len(latest) > K:
    return []
  
  filt = with_prev((lambda x,p:x-p>C), latest.__contains__)
  return filter(filt, workable)

print("\n".join(map(str, solve())))


Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
import itertools
n, k, c = map(int, input().split())
s = input()
a = [i for i in range(n)]
b = list(itertools.combinations(a,k))
for i in b:
    for j in range(k):
        if s[i[j]] == 'x':
            break
        if j != 0:
            if i[j] - i[j-1] <= c:
                break
        a = set(a) & set(i)

for i in a:
    print(i+1)

n, k, c = map(int, input().split())
s = input()

dpl = [0 for i in range(n+1)]
dpr = [0 for i in range(n+1)]

for i in range(n):
    dpl[i+1] = (dpl[i] if s[i] == 'x' else
                dpl[i-c] + 1 if i-c >= 0 else
                1)

for i in range(n, 0, -1):
    dpr[i-1] = (dpr[i] if s[i-1] == 'x' else
                dpr[i+c] + 1 if i+c < n else
                1)

for i in range(1, n+1):
    if dpl[i-1] + dpr[i] < k:
        print(i)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S. Takahashi will choose his workdays as follows:    * After working for a day, he will refrain from working on the subsequent C days.   * If the i-th character of S is `x`, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.  Find all days on which Takahashi is bound to work.

Submission attempts (in order):
N, K, C = map(int, input().split())
S = input()

L = []
R = []
holiday = 0

for i in range(N):
  if holiday:
    holiday -= 1
  elif S[i] == 'o':
    L.append(i)
    holiday = C
holiday = 0
for i in range(N-1, -1, -1):
  if holiday:
    holiday -= 1
  elif S[i] == 'o':
    R.append(i)
    holiday = C
out = set(L) and set(R)
if len(L) >= K and len(R) >= K:
  for n in out:
    print(n+1)

N, K, C = map(int, input().split())
S = input()

L = []
R = []
holiday = 0

for i in range(N):
  if holiday:
    holiday -= 1
  elif S[i] == 'o':
    L.append(i)
    holiday = C
holiday = 0
for i in range(N-1, -1, -1):
  if holiday:
    holiday -= 1
  elif S[i] == 'o':
    R.append(i)
    holiday = C
out = set(L) and set(R)
if len(L) == K and len(R) == K:
  for n in out:
    print(n+1)

N, K, C = map(int, input().split())
S = input()

L = []
R = []
holiday = 0

for i in range(N):
  if holiday:
    holiday -= 1
  elif S[i] == 'o':
    L.append(i)
    holiday = C
holiday = 0
for i in range(N-1, -1, -1):
  if holiday:
    holiday -= 1
  elif S[i] == 'o':
    R.append(i)
    holiday = C
R = R[::-1]
out = set(L) and set(R)
if len(L) == K:
  for l, r in zip(L, R):
    if l == r: print(l+1)

Verdicts: Wrong Answer

Wrong Answer

Accepted