Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
X,Y,A,B,C = map(int, input().split())
P=sorted(list(map(int,input().split())), reverse=True)
Q=sorted(list(map(int,input().split())), reverse=True)
R=sorted(list(map(int,input().split())), reverse=True)

a=[0]
b=[0]
c=[0]

for i in P[:X]:
    a.append(a[-1]+i)
    
for i in Q[:Y]:
    b.append(b[-1]+i)
      
for i in R:
    c.append(c[-1]+i)
    
ans={0}

for i in range(len(c)):
    for j in range(len(b)):
        for k in range(len(a)):
            if i+j+k==X+Y:
                tmp=c[i]+b[j]+a[k]
                #print(tmp)
                ans.add(tmp)
            else:
                pass
            
print(max(ans))

Fixed submission:
X,Y,A,B,C = map(int, input().split())
P=sorted(list(map(int,input().split())), reverse=True)
Q=sorted(list(map(int,input().split())), reverse=True)
R=sorted(list(map(int,input().split())), reverse=True)

C = P[:X] + Q[:Y] + R
C.sort(reverse=True)

print(sum(C[:X+Y]))

Buggy python submission (verdict: Time Limit Exceeded):
X,Y,A,B,C = map(int, input().split())
p=list(map(int, input().split()))
q=list(map(int, input().split()))
r=list(map(int, input().split()))

P=sorted(p, reverse=True)
Q=sorted(q, reverse=True)
R=sorted(r, reverse=True)

a=[0]
b=[0]
c=[0]

for i in P[:X]:
    a.append(a[-1]+i)
    
for i in Q[:Y]:
    b.append(b[-1]+i)
      
for i in R:
    c.append(c[-1]+i)
    
ans={0}

for i in range(len(c)):
    for j in range(len(b)):
        for k in range(len(a)):
            if i+j+k==X+Y:
                tmp=c[i]+b[j]+a[k]
                #print(tmp)
                ans.add(tmp)
            else:
                pass
            
print(max(ans))

Fixed submission:
X,Y,A,B,C = map(int, input().split())
P=sorted(list(map(int,input().split())), reverse=True)
Q=sorted(list(map(int,input().split())), reverse=True)
R=sorted(list(map(int,input().split())), reverse=True)

C = P[:X] + Q[:Y] + R
C.sort(reverse=True)

print(sum(C[:X+Y]))
Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A=list(map(int,input().split()))
#print(A)
B=collections.Counter(A)
#print(B)
for i in A:
    tmp=0
    for k,v in B.items():
        if i==k:
            tmp+=int(0.5*(v-1)*(v-2))
            
        else:
            tmp+=int(0.5*(v)*(v-1))
 
    print(tmp)

Fixed submission:
from collections import Counter
N = int(input())
A=list(map(int,input().split()))
B=Counter(A)
tmp=0
for i in B.values():
    tmp+=int(0.5*(i)*(i-1))
    #print(tmp)
for i in A:            
    print(tmp-B[i]+1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A=list(map(int,input().split()))
#print(A)
B=collections.Counter(A)
#print(B)
for i in A:
    tmp=0
    for k,v in B.items():
        if i==k:
            tmp+=int(0.5*(v-1)*(v-2))
            
        else:
            tmp+=int(0.5*(v)*(v-1))
 
    print(tmp)

Fixed submission:
from collections import Counter
N = int(input())
A=list(map(int,input().split()))
B=Counter(A)
tmp=0
for i in B.values():
    tmp+=int(0.5*(i)*(i-1))
    #print(tmp)
for i in A:            
    print(tmp-B[i]+1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A=list(map(int,input().split()))
#print(A)
B={}
for i in A:
    #print(i)
    if i in B:
        B[i]=B[i]+1
        #print(B)
    else:
        B[i]=1
        #print(B)

for i in A:
    tmp=0
    for k,v in B.items():
        if i==k:
            tmp+=int(0.5*(v-1)*(v-2))
            
        else:
            tmp+=int(0.5*(v)*(v-1))

    print(tmp)


Fixed submission:
from collections import Counter
N = int(input())
A=list(map(int,input().split()))
B=Counter(A)
tmp=0
for i in B.values():
    tmp+=int(0.5*(i)*(i-1))
    #print(tmp)
for i in A:            
    print(tmp-B[i]+1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A=list(map(int,input().split()))
#print(A)

for i in range(N):
    count=0
    for j in range(N):
        
        for k in range(j,N):
            if i==j:
                continue
            elif j==k or i==k:
                continue
            #print(A[j],A[k])
            if A[j]==A[k]:
                count+=1
            else:
                pass
    print(count)


Fixed submission:
from collections import Counter
N = int(input())
A=list(map(int,input().split()))
B=Counter(A)
tmp=0
for i in B.values():
    tmp+=int(0.5*(i)*(i-1))
    #print(tmp)
for i in A:            
    print(tmp-B[i]+1)
Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
Q=int(input())
for i in range(Q):
    tmp=list(input().split())
    a=tmp[0]
    #print(tmp)
    if a=='1':
        S.reverse()
    elif a=='2' and tmp[1]=='1':
        S.insert(0,tmp[2])
    else:
        S.append(tmp[2])
print(*S,sep='')

Fixed submission:
S = input()
Q = int(input())
 
a = []
b = []
rev = 0
 
for _ in range(Q):
    q = input().split()
    if q[0] == '1':
        a, b = b, a
        rev += 1
    else:
        if q[1] == '1':
            a.append(q[2])
        else:
            b.append(q[2])
if rev % 2 == 1:
    S = S[::-1]
ans = ''.join(a[::-1]) + S + ''.join(b)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
B=list(map(int,input().split()))
C=[]
for i in range(len(B)-K+1):
    tmp=0
    for j in range(K):
        tmp+=(1+B[i+j])/2
    C.append(tmp)
print(max(C))

Fixed submission:
import itertools
N,K=map(int,input().split())
B=list(map(int,input().split()))
C=[0]+list(itertools.accumulate([(x+1)/2 for x in B]))

D=max(C[i]-C[i-K] for i in range(K,N+1))
print(D)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A=list(map(int,input().split()))
ans=[]

for i in range(n):
    D=min(A[j] for j in range(i+1))
    ans.append(D)
    
print(len(set(ans)))


Fixed submission:
n = int(input())
A=list(map(int,input().split()))
cnt=0
tmp=n+1
for i in range(n):
    if A[i]<=tmp:
        tmp=A[i]
        cnt+=1
    else:
        pass
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A=list(map(int,input().split()))
cnt=0
for i in range(n):
    D=min(A[j] for j in range(i+1))
    #print(D)
    if A[i]<=D:
        cnt+=1
    else:
        pass
print(cnt)


Fixed submission:
n = int(input())
A=list(map(int,input().split()))
cnt=0
tmp=n+1
for i in range(n):
    if A[i]<=tmp:
        tmp=A[i]
        cnt+=1
    else:
        pass
print(cnt)
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
    
N,M=map(int,input().split())
A=set(map(int,input().split()))
cnt=0
B=[]
C=[]

for i in A:
    tmp=(i/2)
    if tmp%2!=0:
        B.append(i)
    else:
        C.append(i)
#print(B)        
q=lcm(*A)
#print(q)
if len(A)==len(B) or len(A)==len(C):
    if 2*M<q:
        print(0)
    elif (2*M//q)%2==0:
        print(2*M//(2*q))
    else:
        print(2*M//(2*q)+1)
else:
    print(0)


Fixed submission:
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
    
N,M=map(int,input().split())
A=[int(i)//2 for i in input().split()]
q=lcm(*A)
#print(q)
for i in A:
    #print(i)
    if q//i%2==0:
        print(0)
        exit()
print((M//q+1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
R,S,P=map(int,input().split())
T=list(input())
A=[[]*(N//K+1) for i in range(K)]
for i in range(N):
    for j in range(K):
        if i%K==j:
            A[j].append(T[i])
        else:
            pass
ans=0
flag=None
for i in range(K):
    for j in range(len(A[i])):
        if j==0:
            if A[i][j]=='r':
                ans+=P
                flag='r'
            elif A[i][j]=='s':
                ans+=R
                flag='s'
            else:
                ans+=S
                flag='p'
        elif A[i][j]==flag:
            flag=None
    
        else:
            if A[i][j]=='r':
                ans+=P
                flag='r'
            elif A[i][j]=='s':
                ans+=R
                flag='s'
            else:
                ans+=S
                flag='p'
print(ans)
        

Fixed submission:
N,K=map(int,input().split())
R,S,P=map(int,input().split())
T=list(input())

ans=0

for j in range(len(T)):
    if j<K:
        if T[j]=='r':
            ans+=P
        elif T[j]=='s':
            ans+=R
        else:
            ans+=S
    elif j>=K and T[j]!=T[j-K]:
        if T[j]=='r':
            ans+=P
        elif T[j]=='s':
            ans+=R
        else:
            ans+=S
    else:
        T[j]=''
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))

ans=0
for i in range(N):
    #print(ans)
    flag='on'
    if ans+i==N:
        break
    for j in range(len(a)):
        if a[j]==i+1:
            break
        elif a[j]==0:
            continue
        elif a[j]==i and flag=='on':
            a[j]=0
            flag='off'
        else:
            a[j]=0
            ans+=1
        #print(a)

if ans==N:
    print(-1)
else:
    print(ans)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))

ans=0
if min(a)!=1:
    print(-1)
else:
    for i in range(N):
        if a[i]==ans+1:
            ans+=1
    print(N-ans)
Buggy python submission (verdict: Runtime Error):
s = str(input())
t = str(input())
count = 0

for i in range(len(s)):
    if s[i] != t[i]:
        count +=1

print(count)

Fixed submission:
a  = int(input())
print(a+a**2+a**3)
Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())

answer = "No"

for i in range(x + 1):
  b = x - i
  if a * 2 + b * 4 == y:
    answer = "Yes"

print(answer)


Fixed submission:
animals_num, legs_num = map(int, input().split())

answer = "No"

for i in range(animals_num + 1):
  j = animals_num - i
  if j * 4 + i * 2 == legs_num:
    answer = "Yes"
print(answer)

Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())

answer = "No"

for i in range(x + 1):
  y = x - i
  if a * 2 + b * 4 == y:
    answer = "Yes"

print(answer)

Fixed submission:
animals_num, legs_num = map(int, input().split())

answer = "No"

for i in range(animals_num + 1):
  j = animals_num - i
  if j * 4 + i * 2 == legs_num:
    answer = "Yes"
print(answer)
Buggy python submission (verdict: Runtime Error):
number, base = map(int, input().split())
result_list = []
while number / base > 0:
  mod = number % base
  result_list.append(str(mod))
  number = number // base

result_list.reverse()
result = "".join(result_list)
print(len(result))


Fixed submission:
count, outrate = map(int, input().split())

if count >= 10:
  result = outrate
  print(result)
else:
  result = outrate + 100 * (10 - count)
  print(result)

Buggy python submission (verdict: Runtime Error):
number, base = map(int, input().split())
result_list = []
while number / base > 0:
  mod = number % base
  result_list.append(str(mod))
  number = number // base

result_list.reverse()
result = "".join(result_list)
print(result)


Fixed submission:
count, outrate = map(int, input().split())

if count >= 10:
  result = outrate
  print(result)
else:
  result = outrate + 100 * (10 - count)
  print(result)

Buggy python submission (verdict: Runtime Error):
count, outrate = input().split()
if count >= 10:
  result = outrate
  print(result)
else:
  result = outrate + 100 * (10 - count)
  print(result)


Fixed submission:
count, outrate = map(int, input().split())

if count >= 10:
  result = outrate
  print(result)
else:
  result = outrate + 100 * (10 - count)
  print(result)

Buggy python submission (verdict: Runtime Error):
count, outrate = input().split()
if count >= 10:
  result = outrate
  print(inrate)
else:
  result = outrate + 100 * (10 - count)
  print(result)

Fixed submission:
count, outrate = map(int, input().split())

if count >= 10:
  result = outrate
  print(result)
else:
  result = outrate + 100 * (10 - count)
  print(result)
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
o=0
for i in range(len(s)):
  if s[i]!=t[i]:
		o+=1
print(o)

Fixed submission:
s=input()
t=input()
o=0
for i in range(len(s)):
  if s[i]!=t[i]:
    o+=1
print(o)

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
o=0
for x,y in s,t:
  if x != y:
    o+=1
print(o)
  

Fixed submission:
s=input()
t=input()
o=0
for i in range(len(s)):
  if s[i]!=t[i]:
    o+=1
print(o)
Buggy python submission (verdict: Runtime Error):
age,cost =list(map(int, input().split()))
if age<=5:
  print('0')
elif age>=6 and age<=12:
  print(a//2)
elif age>=13:
  print(a)


Fixed submission:
n,k=tuple(map(int,input().split()))
if n >= 13:
  print(k)
elif 6 <= n <= 12:
  print(k//2)
elif n <= 5:
  print(0)

Buggy python submission (verdict: Runtime Error):
age,cost= list(map(int, input().split()))
if 0<age<100 and 2<cost<1000:
	if age<=5:
      print('0')
	elif age>=6 and age<=12:
      print(a/2)
	else:
  	  print(a)


Fixed submission:
n,k=tuple(map(int,input().split()))
if n >= 13:
  print(k)
elif 6 <= n <= 12:
  print(k//2)
elif n <= 5:
  print(0)

Buggy python submission (verdict: Runtime Error):
age,cost= list(map(int, input().split()))
if age<=5:
  print('0')
elif age>=6 and age<=12:
  print(a/2)
else:
  print(a)


Fixed submission:
n,k=tuple(map(int,input().split()))
if n >= 13:
  print(k)
elif 6 <= n <= 12:
  print(k//2)
elif n <= 5:
  print(0)

Buggy python submission (verdict: Runtime Error):
age,cost=list(map(int, input().split()))
age=x[0]
cost=x[1]
if age<=5:
  print('0')
elif age>=6 and age<=12:
  print(a/2)
else:
  print(a)


Fixed submission:
n,k=tuple(map(int,input().split()))
if n >= 13:
  print(k)
elif 6 <= n <= 12:
  print(k//2)
elif n <= 5:
  print(0)

Buggy python submission (verdict: Runtime Error):
x=list(map(int, input()))
age=x[0]
cost=x[1]
if age<=5:
  print('0')
elif age>=6 and age<=12:
  print(a/2)
else:
  print(a)

Fixed submission:
n,k=tuple(map(int,input().split()))
if n >= 13:
  print(k)
elif 6 <= n <= 12:
  print(k//2)
elif n <= 5:
  print(0)
Buggy python submission (verdict: Runtime Error):
b=int(input())
c=input()
c=c.replace(c[b-1],c[b-1].lower())
print(c)

Fixed submission:
N, K = map(int, input().split())
S = input()
K -= 1
answer = S[:K] + S[K].lower() + S[K+1:]
print(answer)

Buggy python submission (verdict: Runtime Error):
c=c.replace(c[b-1],c[b-1].upper())

Fixed submission:
N, K = map(int, input().split())
S = input()
K -= 1
answer = S[:K] + S[K].lower() + S[K+1:]
print(answer)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=input()
c=c.replace(c[b-1],c[b-1].lower())
print(c)

Fixed submission:
N, K = map(int, input().split())
S = input()
K -= 1
answer = S[:K] + S[K].lower() + S[K+1:]
print(answer)
Buggy python submission (verdict: Runtime Error):
s=map(str,input().split())
if A not in s or B not in s:
  print("No")
else:
  print("Yes")

Fixed submission:
s=input()
s=list(s)
if "A" not in s or "B" not in s:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
ax=set(range(math.ceil(25*a/2),math.floor(25*(a+0.99999)/2)+1))
bx=set(range(math.ceil(10*b),math.floor(10*(b+0.99999)))+1)
x=list(ax&bx)
if x:
  print(x[0])
else:
  print(-1)

Fixed submission:
import math
a,b=map(int,input().split())
for i in range(2000):
  if math.floor((i+1)*0.08)==a and math.floor((i+1)*0.1)==b:
    print(i+1)
    exit()
print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
qnum=int(input())
q=[input().split() for i in range(qnum)]
dire=True
for i in q:
  if i[0]=="1":
    if dire==True:
      dire=False
    else:
      dire=True
  else:
    if i[1]=="1":
      if dire==True:
        s=i[2]+s
      else:
        s=s+i[2]
    else:
      if dire==True:
        s=s+i[2]
      else:
        s=i[2]+s
if dire==True:
  print(s)
else:
  print(s[::-1])

Fixed submission:
s=input()
n=int(input())
t=""
for _ in range(n):
  q=input().split()
  if q[0]=="1":
    t,s=s,t
  else:
    if q[1]=="1":
      t+=q[2]
    else:
      s+=q[2]
t=t[::-1]
print(t+s)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
qnum=int(input())
q=[input().split() for i in range(qnum)]
for i in q:
  if i[0]=="1":
    s=s[::-1]
  else:
    if i[1]=="1":
      s=i[2]+s
    else:
      s=s+i[2]
print(s)

Fixed submission:
s=input()
n=int(input())
t=""
for _ in range(n):
  q=input().split()
  if q[0]=="1":
    t,s=s,t
  else:
    if q[1]=="1":
      t+=q[2]
    else:
      s+=q[2]
t=t[::-1]
print(t+s)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(map(int,input().split()))
s=set(a,b,c)
if len(s)==2:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c=map(int,input().split())
s=set([a,b,c])
if len(s)==2:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
import sys
myset=set()
for n in range(3):
	myset[n-1].add(sys.argv[n])
if len(myset)==2:
	print("Yes")
else:
	print("No")

Fixed submission:
a,b,c=map(int,input().split())
s=set([a,b,c])
if len(s)==2:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n=int(input())
a=[str(input()) for i in range(n)]
b=sorted(set(a),key=lambda x:x)
b=[[i,0]for i in b]
lenb=range(len(b))
for i in lenb:
  for j in a:
    if j==b[i][0]:
      b[i][1]+=1
c=np.array([i[1] for i in b])
maxb=max(c)
#b=sorted(b,key=lambda x:x[0])
for i in lenb:
  if b[i][1]==maxb:
    print(b[i][0])

Fixed submission:
n=int(input())
a=[str(input()) for i in range(n)]
b={}
for i in a:
  if i in b:
    b[i]+=1
  else:
    b[i]=0
maxb=max(b.values())
b=sorted(b.items(),key=lambda x:x[0])
for i,j in b:
  if maxb==j:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n=int(input())
a=np.array([str(input()) for i in range(n)])
b=set(a)
b=[[i,0]for i in b]
lenb=range(len(b))
for i in lenb:
  for j in a:
    if j==b[i][0]:
      b[i][1]+=1
c=np.array([i[1] for i in b])
maxb=max(c)
b=sorted(b,key=lambda x:x[0])
for i in lenb:
  if b[i][1]==maxb:
    print(b[i][0])

Fixed submission:
n=int(input())
a=[str(input()) for i in range(n)]
b={}
for i in a:
  if i in b:
    b[i]+=1
  else:
    b[i]=0
maxb=max(b.values())
b=sorted(b.items(),key=lambda x:x[0])
for i,j in b:
  if maxb==j:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[str(input()) for i in range(n)]
b=set(a)
b=[[i,0]for i in b]
lenb=range(len(b))
for i in lenb:
  for j in a:
    if j==b[i][0]:
      b[i][1]+=1
maxb=max(b,key=lambda x:x[1])
maxb=maxb[1]
b=sorted(b,key=lambda x:x[0])
for i in lenb:
  if b[i][1]==maxb:
    print(b[i][0])
    

Fixed submission:
n=int(input())
a=[str(input()) for i in range(n)]
b={}
for i in a:
  if i in b:
    b[i]+=1
  else:
    b[i]=0
maxb=max(b.values())
b=sorted(b.items(),key=lambda x:x[0])
for i,j in b:
  if maxb==j:
    print(i)
Buggy python submission (verdict: Runtime Error):
x=int(input())
t=int(x/2)
y=str(input())
if x%2!=0:
  print("No")
  exit()
for i in range(x):
  if y[i]!=y[i+x]:
    print("No")
    exit()
print("Yes")

Fixed submission:
x=int(input())
t=int(x/2)
y=str(input())
if x%2!=0:
  print("No")
  exit()
for i in range(t):
  if y[i]!=y[i+t]:
    print("No")
    exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
            print(i, sum)
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


a, b, c, d = map(int, input().split())

def count(st, n):
    ans = (b - st + 1) // n
    return ans


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


sum = 0
cc = 0
cflag = True
dflag = True
cdflag = True
for i in range(a, b + 1):
    if i % c == 0 and cflag:
        sum += count(i, c)
        cc += 1
        cflag = False
    if i % d == 0 and dflag:
        if dflag:
            sum += count(i, d)
            cc += 1
            dflag = False
        if i % c == 0 and cdflag:
            l = lcm(c, d)
            sum -= count(i, l)
            cc += 1
            cdflag = False
    if cc == 3:
        break
print(b - a + 1 - sum)


Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


def count(n):
    return b // n - (a - 1) // n


a, b, c, d = map(int, input().split())
print(b - a + 1 - (count(c) + count(d) - count(lcm(c, d))))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())


def cc(n):
    i = 
    while True:
        if K <= (n * (2 ** i)):
            return i
        i += 1


A = 0
for n in range(1, N+1):
    A += 1.0 / N * (0.5 ** cc(n))
print(A)


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


def cc(n):
    i = 0
    while True:
        if K <= (n * (2 ** i)):
            return i
        i += 1


A = 0
for n in range(1, N+1):
    A += 1.0 / N * (0.5 ** cc(n))
print(A)
Buggy python submission (verdict: Time Limit Exceeded):
r, g, b, n = map(int, input().split())
count=0
for i in range(n//r+1):
    for j in range(n//g+1):
        for k in range(n//b+1):
            if r*i+j*g+b*k==n:
                count+=1
print(count)


Fixed submission:
r, g, b, n = map(int, input().split())
count = 0
for i in range(n // r + 1):
    for j in range(n // g + 1):
        if (n - r * i - j * g) % b == 0 and (n - r * i - j * g) >= 0:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(input().split())
p.sort()
print(sum(p[0:n]))

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
print(sum(p[0:k]))
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
a=b=c=d=e=f=0
flag=False
for a in range(x//100+1):
  for b in range(x//101+1):
    for c in range(x//102+1):
      for d in range(x//103+1):
        for e in range(x//104+1):
          for f in range(x//105+1):
            if a*100+b*101+c*102+d*103+e*104+f*105==x:
              flag=True
              print(1)
              break
          if flag:
            break
        if flag:
          break
      if flag:
        break
    if flag:
      break
  if flag:
    break
if flag==False:
  print(0)

Fixed submission:
x=int(input())
y=1  # y個購入すると題意をみたす時、1<=y<=x//100、実際に支払い可能な金額は100＊y〜105＊y
if x<100:
  print(0)
else:
  while y<=x//100+1:
    if y*100<=x<=y*105:
      print(1)
      break
    elif y>x//100:
      print(0)
      break
    else:
      y+=1
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
print(len(set(a)==len(a))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
print("YES" if len(set(a))==len(a) else "NO")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
dic={3:1,2:2,1:3}
c=0
if a==1 and b==1:
	c+=dic[a]*10**5+dic[b]*10**5+4*10**5
    print(c)
    
else:
  if a in dic and b in dic:
    c+=dic[a]*10**5+dic[b]*10**5
    print(c)
   
  elif a in dic and b not in dic:
    c+=dic[a]*10**5
    print(c)
    
  elif a not in dic and b in dic:
    c+=dic[b]*10**5
    print(c)
   
    


Fixed submission:
a,b=map(int,input().split())
dic={1:3*10**5,2:2*10**5,3:1*10**5}
c=0
if a in dic and b in dic:
    if a==1 and b==1:
        c+=dic[a]+dic[b]+4*10**5
        print(c)
    else:
        c+=dic[a]+dic[b]
        print(c)

elif a in dic and b not in dic:
    c+=dic[a]
    print(c)


elif b in dic and a not in dic:
    c+=dic[b]
    print(c)

else:
    print(c)
Buggy python submission (verdict: Runtime Error):
strings = sorted(a)
N = int(input())


set_index = ''
while N > 0:
    N -= 1
    index = (N % 26) + ord('a')
    set_index += chr(index)
    N //= 26
print(set_index[::-1])

Fixed submission:
N = int(input())
set_index = ''
while N > 0:
    N -= 1
    index = (N % 26) + ord('a')
    set_index += chr(index)
    N //= 26
print(set_index[::-1])