Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
values = [str(i+1) for i in range(N)]
dic = {key: val for key, val in zip(A, values)}
dic_s = deque(sorted(dic.items()))
s =[]
for i in range(N):
    s.append(dic_s[i][1])

ans = ' '.join(s)
print(ans)

Fixed submission:
from collections import deque
N = int(input())
A = [int(i) for i in input().split()]
values = [str(i+1) for i in range(N)]
dic = {key: val for key, val in zip(A, values)}
dic_s = deque(sorted(dic.items()))
s =deque()
for i in range(N):
    s.append(dic_s[i][1])

ans = ' '.join(list(s))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
N = int(input())
A = [int(i) for i in input().split()]

s = deque()
for i in range(N):
    s.append(str(A.index(i+1)+1))

ans = ' '.join(s)
print(ans)

Fixed submission:
from collections import deque
N = int(input())
A = [int(i) for i in input().split()]
values = [str(i+1) for i in range(N)]
dic = {key: val for key, val in zip(A, values)}
dic_s = deque(sorted(dic.items()))
s =deque()
for i in range(N):
    s.append(dic_s[i][1])

ans = ' '.join(list(s))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

s = []
for i in range(N):
    s.append(str(A.index(i+1)+1))

ans = ' '.join(s)
print(ans)

Fixed submission:
from collections import deque
N = int(input())
A = [int(i) for i in input().split()]
values = [str(i+1) for i in range(N)]
dic = {key: val for key, val in zip(A, values)}
dic_s = deque(sorted(dic.items()))
s =deque()
for i in range(N):
    s.append(dic_s[i][1])

ans = ' '.join(list(s))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
A, B = map(int, input().split())
f=fractions.gcd(A,B)

ans = 1
i = 2
while i <= f:
    if f % i == 0:
        ans += 1
    while f % i == 0:
        f = f//i
    i += 1
    
print(ans)

Fixed submission:
import fractions
A, B = map(int, input().split())
f=fractions.gcd(A,B)

ans = 1
i = 2
while i ** 2 <= f:
    if f % i == 0:
        ans += 1
    while f % i == 0:
        f = f//i
    i += 1

ans +=(f>1)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = [int(i) for i in input().split()] 
A_sorted = sorted(A, reverse=True)

for i in range(M):
    s = A_sorted[:i+1]
    A_sorted[A_sorted.index(max(s))] /= 2 

ans = 0
for i in range(N):
    ans += A_sorted[i]//1
    
print(int(ans))

Fixed submission:
import heapq
N, M = map(int, input().split())
A = [-int(i) for i in input().split()]
heapq.heapify(A)

for i in range(M):
    tmp_min = heapq.heappop(A)
    heapq.heappush(A, (-tmp_min//2)*(-1))
    

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = [int(i) for i in input().split()]

for i in range(M):
    A[A.index(max(A))] /= 2

ans = 0
for i in range(N):
    ans += A[i]//1
    
print(int(ans))

Fixed submission:
import heapq
N, M = map(int, input().split())
A = [-int(i) for i in input().split()]
heapq.heapify(A)

for i in range(M):
    tmp_min = heapq.heappop(A)
    heapq.heappush(A, (-tmp_min//2)*(-1))
    

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
A_sorted = sorted(A, reverse=True)
for i in range(M):
    A_sorted[0] = (A_sorted[0])/2
    A_sorted = sorted(A_sorted, reverse=True)

ans = 0
for i in range(N):
    ans += A_sorted[i]//1
    
print(int(ans))

Fixed submission:
import heapq
N, M = map(int, input().split())
A = [-int(i) for i in input().split()]
heapq.heapify(A)

for i in range(M):
    tmp_min = heapq.heappop(A)
    heapq.heappush(A, (-tmp_min//2)*(-1))
    

print(-sum(A))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
dp = [0]*N

for i in range(N):
    j = i+1
    while S[i:j] in S[j:N]:
        dp[i] += 1
        j += 1
print(max(dp))

Fixed submission:
N = int(input())
S = input()
dp = [0]*N
j = 1

for i in range(N):
    while S[i:j] in S[j:N]:
        dp[i] = j-i
        j += 1
print(max(dp))
Buggy python submission (verdict: Runtime Error):
N, K = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
numc = 0
numf = 0

for i in range(0, N):
    for j in range(0,i):
        if A[j] > A[i]:
            numc += 1
        if A[i] > A[j]:
            numf += 1
numbers = numc*K*(K+1) % (10**9+7)+ numf*K*(K-1) % (10**9+7)
 
ans = int(numbers/2 % (10**9 + 7))
print(ans)

Fixed submission:
M, D = (int(i) for i in input().split())

days = 0

for m in range(1, M+1):
    for d in range(1, D+1):
        d1 = d % 10
        d2 = d // 10
        if d1 >= 2 and d2 >= 2 and d1*d2 == m:
            days += 1

print(days)
Buggy python submission (verdict: Runtime Error):
n = input()
a = input().split(' ')
a_int = [int(i) for i in asp]

arev_sum = 0
for i in a_int:
    arev_sum += round(1/i, 5)
    
ans = round(1/arev_sum, 5)
print(ans)

Fixed submission:
n = input()
a = input().split(' ')
a_int = [int(i) for i in a]

arev_sum = 0
for i in a_int:
    arev_sum += 1/i
    
ans = 1/arev_sum
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
a = input().split(' ')
a_int = [int(i) for i in asp]

arev_sum = 0
for i in a_int:
    arev_sum += 1/i
    
ans = 1/arev_sum
print(ans)

Fixed submission:
n = input()
a = input().split(' ')
a_int = [int(i) for i in a]

arev_sum = 0
for i in a_int:
    arev_sum += 1/i
    
ans = 1/arev_sum
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
a = input().split()
a_int = [int(i) for i in asp]
arev_sum = 0
for i in a_int:
    arev_sum += 1/i
ans = 1/arev_sum
print(ans)

Fixed submission:
n = input()
a = input().split(' ')
a_int = [int(i) for i in a]

arev_sum = 0
for i in a_int:
    arev_sum += 1/i
    
ans = 1/arev_sum
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for i in range(0, N)]

ans = 0

for i in range(0, N):
    S[i] = sorted([i for i in S[i]])
    
for i in range(0, N):
    for j in range(0, i):
        if S[i] == S[j]:
            ans += 1

print(ans)

Fixed submission:
N = int(input())
S = [input() for i in range(0, N)]

ans = 0
A = {}

for i in range(0, N):
    S[i] = sorted(S[i])
    S[i] = ''.join(S[i]) 
    if S[i] in A.keys():
        ans += A[S[i]]
        A[S[i]] += 1
    else:
        A[S[i]] = 1
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for i in range(0, N)]
for i in range(N):
    Adel = A[:i] + A[i+1:]
    print(max(Adel))

Fixed submission:
N = int(input())
A = [int(input()) for i in range(0, N)]
ans1 = max(A)
s = A.index(ans1)

if A.count(ans1) >= 2:
    for i in range(N):
        print(ans1)
else:
    for i in range(N):
        if i == s:
            A.remove(ans1)
            print(max(A))
        else:
            print(ans1)
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())
Lmin = L % 2019
Rmin = R % 2019
anlis = []

if L-R >= 2019 or Lmin > Rmin:
    print(0)
    
else:
    for j in range(Lmin, Rmin+1):
        for i in range(Lmin, j):
            anlis.append((i * j) % 2019)



print(min(anlis))

Fixed submission:
L, R = map(int, input().split())
Lmin = L % 2019
Rmin = R % 2019
anlis = []

if R-L >= 2018 or Lmin > Rmin:
    print(0)
    
else:
    for j in range(Lmin+1, Rmin+1):
        for i in range(Lmin, j):
            anlis.append((i * j) % 2019)
    print(min(anlis))
Buggy python submission (verdict: Runtime Error):
import sympy
N = int(input())
A = [int(i) for i in input().split()]
ans = [x*2]

x = sympy.Symbol('x')
s = x
for i in range(1, N):
    s = A[i-1]-s
    ans.append(s*2)
    
sol = sympy.solve(A[N-1]-s-x)[0]
for i in range(N):
    ans[i] = ans[i].subs(x, sol)
    print(ans[i], end = " ")

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
s = 0

for i in range(N):
    s = A[i]-s
    
s = s//2
ans = [s*2]
for i in range(1,N):
    s = A[i-1] - s
    ans.append(s*2)
    
for i in range(N):
    print(ans[i], end = " ")

Buggy python submission (verdict: Runtime Error):
import sympy
N = int(input())
A = [int(i) for i in input().split()]
ans = [x*2]

x = sympy.Symbol('x')
s = x
for i in range(1, N):
    s = A[i-1]-s
    ans.append(s*2)
    
sol = sympy.solve(A[N-1]-s-x)[0]
for i in range(N):
    ans[i] = str(ans[i].subs(x, sol))
print(' '.join(ans))

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
s = 0

for i in range(N):
    s = A[i]-s
    
s = s//2
ans = [s*2]
for i in range(1,N):
    s = A[i-1] - s
    ans.append(s*2)
    
for i in range(N):
    print(ans[i], end = " ")

Buggy python submission (verdict: Runtime Error):
import sympy
N = int(input())
A = [int(i) for i in input().split()]
ans = [x*2]

x = sympy.Symbol('x')
s = x
for i in range(1, N):
    s = A[i-1]-s
    ans.append(s*2)
    
sol = sympy.solve(A[N-1]-s-x)[0]
for i in range(N):
    ans[i] = ans[i].subs(x, sol)
print(ans)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
s = 0

for i in range(N):
    s = A[i]-s
    
s = s//2
ans = [s*2]
for i in range(1,N):
    s = A[i-1] - s
    ans.append(s*2)
    
for i in range(N):
    print(ans[i], end = " ")
Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
s = 10**9+7
for i in range(1, K+1):
    ans1 = (math.factorial(N-K+1)) // (math.factorial(i)) //(math.factorial(N-K-i+1))
    ans2 = (math.factorial(K-1)) // (math.factorial(i-1)) // (math.factorial(K-i))
    print(ans1 % s * ans2 % s)

Fixed submission:
N, K = map(int, input().split())
s = 10**9+7
x = N-K+1
y = 1
for i in range(1, K+1):
    print(x*y%s)
    x = x * (N-K+1-i) // (i+1)
    y = y * (K-i) // i

Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
for i in range(1, K+1):
    ans1 = math.factorial(N-K+1) // math.factorial(i) // math.factorial(N-K-i+1)
    ans2 = math.factorial(K-1) // math.factorial(i-1) // math.factorial(K-i)
    print(ans1*ans2 % (10**9 + 7))

Fixed submission:
N, K = map(int, input().split())
s = 10**9+7
x = N-K+1
y = 1
for i in range(1, K+1):
    print(x*y%s)
    x = x * (N-K+1-i) // (i+1)
    y = y * (K-i) // i

Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
for i in range(1, K+1):
    ans1 = math.factorial(N-K+1) // math.factorial(i) // math.factorial(N-K-i+1)
    ans2 = math.factorial(K-1) // math.factorial(i-1) // math.factorial(K-i)
    print(ans1*ans2)

Fixed submission:
N, K = map(int, input().split())
s = 10**9+7
x = N-K+1
y = 1
for i in range(1, K+1):
    print(x*y%s)
    x = x * (N-K+1-i) // (i+1)
    y = y * (K-i) // i
Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())
A = A-1
f=math.gcd(C,D)
f2=C*D//f

Aans = A - (A//C + A//D - A//f2)
Bans = B - (B//C + B//D - B//f2)
print(Bans- Aans)

Fixed submission:
import fractions
A, B, C, D = map(int, input().split())
A = A-1
f=fractions.gcd(C,D)
f2=C*D//f

Aans = A - (A//C + A//D - A//f2)
Bans = B - (B//C + B//D - B//f2)
print(Bans- Aans)
Buggy python submission (verdict: Runtime Error):
a = input()
 
if str.isupper(a):
  print('A')
else :
  ptint('a')

Fixed submission:
a = input()
 
if str.isupper(a):
  print('A')
else :
  print('a')

Buggy python submission (verdict: Runtime Error):
a = input()
 
if str.isupper(a):
  print("A")
else :
  ptint("a")

Fixed submission:
a = input()
 
if str.isupper(a):
  print('A')
else :
  print('a')

Buggy python submission (verdict: Runtime Error):
a = input()

if str.isupper(a) == ture :
  print("A")
else :
  ptint("a")

Fixed submission:
a = input()
 
if str.isupper(a):
  print('A')
else :
  print('a')
Buggy python submission (verdict: Runtime Error):
N = input()
K = input()
lists = []
B = 0

for i in range(int(N)):
    A = input()
    lists.append(int(A))
    #print(A)

lists.sort()
#print(lists)

for j in range(int(K)):
  B += int(lists[j])
 
print(B)

Fixed submission:
N,K = input().split()
lists = []
B = 0

lists = list(map(int, input().split()))

lists.sort()
#print(lists)

for j in range(int(K)):
  B += int(lists[j])
 
print(B)

Buggy python submission (verdict: Runtime Error):
N = input()
K = input()
lists = []
A = 0

for i in range(int(N)):
  lists.append((input()))
 
lists.sort()
 
A = sum(lists[:K])
 
print(A)

Fixed submission:
N,K = input().split()
lists = []
B = 0

lists = list(map(int, input().split()))

lists.sort()
#print(lists)

for j in range(int(K)):
  B += int(lists[j])
 
print(B)

Buggy python submission (verdict: Runtime Error):
N = input()
K = input()
lists = []
A = 0

for i in range(int(N)):
  lists.append((input()))
 
lists.sort()
 
for j in range(int(K)):
  A += int(lists[j])
 
print(A)

Fixed submission:
N,K = input().split()
lists = []
B = 0

lists = list(map(int, input().split()))

lists.sort()
#print(lists)

for j in range(int(K)):
  B += int(lists[j])
 
print(B)

Buggy python submission (verdict: Runtime Error):
N = input()
K = input()
 
for i in range(N):
  list[i] = input()
 
list.sort()
 
for j in range(K):
  A += list[j]
 
print(A)

Fixed submission:
N,K = input().split()
lists = []
B = 0

lists = list(map(int, input().split()))

lists.sort()
#print(lists)

for j in range(int(K)):
  B += int(lists[j])
 
print(B)

Buggy python submission (verdict: Runtime Error):
N = input()
K = input()

for i in range(N):
  list.append(input())

list.sort()

for j in range(K):
  A += list[j]

print(A)

Fixed submission:
N,K = input().split()
lists = []
B = 0

lists = list(map(int, input().split()))

lists.sort()
#print(lists)

for j in range(int(K)):
  B += int(lists[j])
 
print(B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
count = 0
ans = list()
r = 0
alp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

while N > 26**count:
    count+=1

count = count - 1
count2 = count

while count > 0:
    N = N - 26**count
    count = count - 1

#print(N)

N = N - 1
A = 1
while A != 0:
    A = N // 26
    B = N % 26
    ans.append(B)
    N = A

#print(ans)
#print(len(ans))
#print(count2+1)

while len(ans) < count2 + 1:
    ans.append(0)
    #print(len(ans))

#print(N)
#print(len(ans))
#print(ans)
ans.reverse()
#print(ans)

for i in range(0, len(ans)):
    ans[i] = alp[ans[i]]

#print(ans)

print(''.join(ans))

Fixed submission:
N = int(input())
alphabet_lst = list('abcdefghijklmnopqrstuvwxyz')
#print(alphabet_lst)

keta = 0
keta_lst = []
sum_lst = []
while N>=sum(keta_lst):
    keta_lst.append(26**keta)
    sum_keta = sum(keta_lst)
    sum_lst.append(sum_keta)
    keta += 1
    
keta -= 1
keta_lst = keta_lst[:keta]
#print(keta_lst)
#print(keta)

ans_lst = []
for i in range(keta):
    ans_n = (N - sum(keta_lst[:-(i+1)])) // keta_lst[-(i+1)]
    #print(ans_n)
    #print(keta_lst[-(i+1)])
    N -= ans_n*keta_lst[-(i+1)]
    ans_lst.append(alphabet_lst[ans_n-1])

for i in range(keta):
    print(ans_lst[i],end="")
Buggy python submission (verdict: Runtime Error):
H, A = map(int, input().split())
Ans = 0
 
while (H =< 0):
	H -= A
	Ans += 1
 
print(Ans)

Fixed submission:
H, A = map(int, input().split())
Ans = 0
 
while (H > 0):
	H -= A
	Ans += 1
 
print(Ans)

Buggy python submission (verdict: Runtime Error):
H, A = map(int, input().split())
Ans = 0

while (Ans =< 0):
	H -= A
	Ans += 1

print(Ans)


Fixed submission:
H, A = map(int, input().split())
Ans = 0
 
while (H > 0):
	H -= A
	Ans += 1
 
print(Ans)

Buggy python submission (verdict: Runtime Error):
h, a = map(int, input().split())
Ans = 0
Ans2 = 0
 
while Ans =< 0:
	Ans = h-a
	Ans2 += 1
 
print(Ans2)

Fixed submission:
H, A = map(int, input().split())
Ans = 0
 
while (H > 0):
	H -= A
	Ans += 1
 
print(Ans)

Buggy python submission (verdict: Runtime Error):
h, a = map(int, input().split())
Ans = 0
Ans2 = 0

while Ans =< 0:
	Ans = h-a
	Ans2+=1

print(Ans2)

Fixed submission:
H, A = map(int, input().split())
Ans = 0
 
while (H > 0):
	H -= A
	Ans += 1
 
print(Ans)

Buggy python submission (verdict: Runtime Error):
H = input()
A = input()

while Ans =< 0:
	Ans = H-A
	Ans2++

print(Ans)

Fixed submission:
H, A = map(int, input().split())
Ans = 0
 
while (H > 0):
	H -= A
	Ans += 1
 
print(Ans)
Buggy python submission (verdict: Runtime Error):
H, N = map(int, input().split())
A = map(int, input().split())
Ans = 0

for x in A:
  Ans += x
  
if(Ans >= H):
  print(`Yes`)
else:
  print(`No`)

Fixed submission:
H, N = map(int, input().split())
A = map(int, input().split())
Ans = 0
 
for x in A:
  Ans += x
  
if Ans >= H:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
P = int(input())
Q = int(input())
R = int(input())

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print (Ans1)


Fixed submission:
P,Q,R = map(int,input().split())

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print (Ans1)

Buggy python submission (verdict: Runtime Error):
P = int(input())
Q = int(input())
R = int(input())
 
Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P
 
if(Ans1 > Ans2):
	Ans1 = Ans2
 
if(Ans1 > Ans3):
	Ans1 = Ans3
 
print (Ans1)

Fixed submission:
P,Q,R = map(int,input().split())

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print (Ans1)

Buggy python submission (verdict: Runtime Error):
P = int(input())
Q = int(input())
R = int(input())

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print Ans1

Fixed submission:
P,Q,R = map(int,input().split())

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print (Ans1)
Buggy python submission (verdict: Time Limit Exceeded):
S=input()

out=0
D=len(S)-4
for ii in range(D+1):
    for i in range(ii+3,len(S)):
        T=S[ii:i+1]
        if int(T)%2019==0:
            out+=1
print(out)

Fixed submission:
S=input()

out=0
l=[0]*2019
x=0
now=1
for i in S[::-1]:
    x+=now*int(i)
    x%=2019
    l[x]+=1

    now*=10
    now%=2019

for i in l:
    out+=(i-1)*i//2
print(out+l[0])

# # 全探索は間に合わない
# D=len(S)-4
# for ii in range(D+1):
#     for i in range(ii+3,len(S)):
#         T=S[ii:i+1]
#         if int(T)%2019==0:
#             out+=1
# print(out)

Buggy python submission (verdict: Time Limit Exceeded):
S=input()

# tmp=[]
# for i in range(2019,S+1,2019):
#     label=1
#     for ii in str(i):
#         if ii=='0':
#             label=0
#     if label:
#         tmp.append(i)
#     #tmp.append(2019*i)
# print(tmp)

out=0
D=len(S)-4
for ii in range(D+1):
    for i in range(ii+3,len(S)):
        T=S[ii:i+1]
        if int(T)%2019==0:
            out+=1
print(out)

Fixed submission:
S=input()

out=0
l=[0]*2019
x=0
now=1
for i in S[::-1]:
    x+=now*int(i)
    x%=2019
    l[x]+=1

    now*=10
    now%=2019

for i in l:
    out+=(i-1)*i//2
print(out+l[0])

# # 全探索は間に合わない
# D=len(S)-4
# for ii in range(D+1):
#     for i in range(ii+3,len(S)):
#         T=S[ii:i+1]
#         if int(T)%2019==0:
#             out+=1
# print(out)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))

L=sum(A)
if L>N:
    print(-1)
else:
    print(N-L)

Fixed submission:
import  math

R=int(input())

print(2*math.pi*R)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

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

def check(S0):
    count=0
    index=0
    while count<K and index<N:
        if S0[index]=='o':
            count+=1
            index+=(C+1)
        else:
            index+=1
    if count==K:
        return 1
    return 0

if check(S)==0:
    print()
else:
    for i in range(N):
        if S[i]=='o':
            S0=S[:i]+'x'+S[i+1:]
            if check(S0)==0:
                print(i+1)

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

def check0(S0):
    count=0
    index=0
    out=[0]*K
    while count<K and index<N:
        if S0[index]=='o':
            out[count]=index
            count+=1
            index+=(C+1)
        else:
            index+=1
    if count==K:
        return 1,out
    return 0,out

def checkend(S0):
    count=0
    index=N-1
    out=[0]*K
    while count<K and index>=0:
        if S0[index]=='o':
            out[K-1-count]=index
            count+=1
            index-=(C+1)
        else:
            index-=1
    if count==K:
        return 1,out
    return 0,out



flag0,out0=check0(S)
flagend,outend=checkend(S)
if flag0==1:
    for i in range(K):
        if out0[i]==outend[i]:
            print(out0[i]+1)
Buggy python submission (verdict: Runtime Error):
# 素因数分解

N=int(input())
cand=[]

def check(N0,K0):
    if N0%K0==0:
        return check(int(N0/K0),K0)
    elif N0%K0==1:
        return 1
    else:
        return 0

def check0(N0,K0):
    while N0%K0==0:
        N0=int(N0/K0)
    if N0%K0==1:
        return 1
    else:
        return 0

# N-1の約数の数
for i in range(2,int((N-1)**0.5)+1):#O(N**0.5)
    if (N-1)%i==0:
        cand.append(i)
        cand.append(int((N-1)/i))

# Nの約数
for i in range(2,int(N**0.5)+1):#O(N**0.5)
    if N%i==0:
        cand.append(i)
        cand.append(int(N/i))
cand.append(N)
cand.append(N-1)

count=0
for i in range(len(cand)):
    if check(N,cand[i]):
        count+=1

print(count)

Fixed submission:
# 素因数分解

N=int(input())
cand=[]

def check(N0,K0):
    if N0%K0==0:
        return check(int(N0/K0),K0)
    elif N0%K0==1:
        return 1
    else:
        return 0

def check0(N0,K0):
    while N0%K0==0:
        N0=int(N0/K0)
    if N0%K0==1:
        return 1
    else:
        return 0

# N-1の約数の数
for i in range(2,int((N-1)**0.5)+1):#O(N**0.5)
    if (N-1)%i==0:
        cand.append(i)
        if i!=int((N-1)/i):
            cand.append(int((N-1)/i))
if N>2:
    cand.append(N-1)

# Nの約数
for i in range(2,int(N**0.5)+1):#O(N**0.5)
    if N%i==0:
        cand.append(i)
        if i!=int(N/i):
            cand.append(int(N/i))
cand.append(N)

#print(cand)
count=0
for i in range(len(cand)):
    if check(N,cand[i]):
        count+=1

print(count)