Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
sys.setrecursionlimit(4100000)
n = int(input())
a = [int(i) for i in input().split()]
current = a[0]
good = True
for i in range(1,n):
    if a[i] < a[i-1]:
        good = False
        break
    if a[i] == a[i-1]:
        continue
    if a[i] > a[i-1]:
        a[i] = a[i] - 1
if good:
    print("Yes")
else:
    print("No")

Fixed submission:
import sys
sys.setrecursionlimit(4100000)
n = int(input())
a = [int(i) for i in input().split()]
current = a[0]
good = True
for i in range(1,n):
    if a[i] < a[i-1]:
        good = False
        break
    if a[i] == a[i-1]:
        continue
    if a[i] > a[i-1]:
        a[i] = a[i] - 1
if good:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
# Setup
import sys
sys.setrecursionlimit(4100000)
n = int(input())
a = [int(input()) for i in range(n)]
heap = []
for i in range(n):
    heapq.heappush(heap,-a[i])
for i in range(n):
    temp = heapq.heappop(heap)
    if -a[i] == temp:
        temp2 = heapq.heappop(heap)
        print(-temp2)
        heapq.heappush(heap,temp)
        heapq.heappush(heap,temp2)
    else:
        print(-temp)
        heapq.heappush(heap,temp)

Fixed submission:
# Setup
import sys
import heapq
sys.setrecursionlimit(4100000)
n = int(input())
a = [int(input()) for i in range(n)]
heap = []
for i in range(n):
    heapq.heappush(heap,-a[i])
for i in range(n):
    temp = heapq.heappop(heap)
    if -a[i] == temp:
        temp2 = heapq.heappop(heap)
        print(-temp2)
        heapq.heappush(heap,temp)
        heapq.heappush(heap,temp2)
    else:
        print(-temp)
        heapq.heappush(heap,temp)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import copy
sys.setrecursionlimit(4100000)

n = int(input())
a = [int(i) for i in input().split()]
m = {}
m[0] = -1
m[1] = a[0] - m[0]/2
while True:
    m[0] += 1
    for i in range(1,n):
        m[i] = 2*(a[i-1] - m[i-1]/2)
    if (m[0] + m[n-1])//2 == a[n-1]:
        break
b = [int(m[i]) for i in m]
print(* b)

Fixed submission:
import sys
import math
import copy
sys.setrecursionlimit(4100000)

n = int(input())
a = [int(i) for i in input().split()]
m = {}
m[0] = 0
m[1] = a[0] - m[0]/2
while True:
    # m[0] += 1
    for i in range(1,n):
        m[i] = 2*(a[i-1] - m[i-1]/2)
    if (m[0] + m[n-1])//2 == a[n-1]:
        break
    else:
        temp = a[n-1] - (m[0] + m[n-1])//2
        m[0] += temp

b = [int(m[i]) for i in m]
print(* b)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(4100000)
import math
a,b,c,d = [int(i) for i in input().split()]
lcm = (c * d) // math.gcd(c, d)
# a = 9-9//2-9//3+9//lcm
# b = 4-4//2-4//3+4//lcm
a -= 1
e = b-b//c-b//d+b//lcm
f = a-a//c-a//d+a//lcm
print(e-f)

Fixed submission:
import sys
sys.setrecursionlimit(4100000)
import fractions
a,b,c,d = [int(i) for i in input().split()]
lcm = (c * d) // fractions.gcd(c, d)
# a = 9-9//2-9//3+9//lcm
# b = 4-4//2-4//3+4//lcm
a -= 1
e = b-b//c-b//d+b//lcm
f = a-a//c-a//d+a//lcm
print(e-f)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
def stairs(step):
  if step in a:
    return 0
  if step == 1:
    return 1
  if step == 2:
    return stairs(step-1) + 1
  if step in dp.keys():
    return dp[step]
  else:
    dp[step] = stairs(step-1) + stairs(step-2)
    return dp[step]
print(int(stairs(n)%1000000007))

Fixed submission:
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
for step in range(1,n+1):
    if step in a:
        dp[step] = 0
        continue
    if step == 1:
        if step in a:
            dp[1] = 0
        else:
            dp[1] = 1
        continue
    if step == 2:
        if step in a:
            dp[2] = dp[1]
        else:
            dp[2] = dp[1] + 1
        continue
    dp[step] = dp[step-1] + dp[step-2]
print(int(dp[n]%1000000007))

Buggy python submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
def stairs(step):
  if step in a:
    return 0
  if step == 1:
    return 1
  if step == 2:
    return stairs(step-1) + 1
  if step in dp.keys():
    return dp[step]
  else:
    dp[step] = stairs(step-1) + stairs(step-2)
    return dp[step]
print(int(stairs(n)%1000000007))


Fixed submission:
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
for step in range(1,n+1):
    if step in a:
        dp[step] = 0
        continue
    if step == 1:
        if step in a:
            dp[1] = 0
        else:
            dp[1] = 1
        continue
    if step == 2:
        if step in a:
            dp[2] = dp[1]
        else:
            dp[2] = dp[1] + 1
        continue
    dp[step] = dp[step-1] + dp[step-2]
print(int(dp[n]%1000000007))

Buggy python submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
def stairs(step):
  if step in a:
    return 0
  if step == 1:
    return 1
  if step == 2:
    return stairs(step-1) + 1
  if step in dp.keys():
    return dp[step]
  else:
    dp[step] = stairs(step-1) + stairs(step-2)
    return dp[step]
print(int(stairs(n)%1000000007))

Fixed submission:
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
for step in range(1,n+1):
    if step in a:
        dp[step] = 0
        continue
    if step == 1:
        if step in a:
            dp[1] = 0
        else:
            dp[1] = 1
        continue
    if step == 2:
        if step in a:
            dp[2] = dp[1]
        else:
            dp[2] = dp[1] + 1
        continue
    dp[step] = dp[step-1] + dp[step-2]
print(int(dp[n]%1000000007))
Buggy python submission (verdict: Time Limit Exceeded):
n, m = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
bc = [[int(i) for i in input().split()] for i in range(m)]
a.sort()
bc.sort(key=lambda x:x[1])

for remain,number in bc:
    for index,value in enumerate(a):
        if remain == 0:
            break
        if value < number:
            a[index] = number
            remain -= 1
        else:
            break
    a.sort()
print(sum(a))

Fixed submission:
from heapq import *
n, m = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
bc = [[int(i) for i in input().split()] for i in range(m)]
heapify(a)
bc.sort(key=lambda x:x[1],reverse=True)
maxlength = bc[0][0]
maxnumber = bc[0][1]
newbc = [[maxlength,maxnumber]]
for k,l in bc:
    if k > maxlength:
        newbc.append([k-maxlength,l])
        maxlength = k

for remain,number in bc:
    while remain > 0:
        temp = heappop(a)
        if number > temp:
            heappush(a,number)
            remain -= 1
        else:
            heappush(a,temp)
            remain = 0
print(sum(a))
Buggy python submission (verdict: Runtime Error):
# Setup
import sys
sys.setrecursionlimit(4100000)

a, b = [int(i) for i in input().split()]
c = [b-int(i) for i in input().split()]
import fractions
import fractions
temp = fractions.gcd(c[1],c[0])
for i in range(2,a):
    temp = fractions.gcd(temp,c[i])
print(temp)

Fixed submission:
# Setup
import sys
sys.setrecursionlimit(4100000)

a, b = [int(i) for i in input().split()]
c = [b-int(i) for i in input().split()]
import fractions
if a >= 2:
  temp = fractions.gcd(c[1],c[0])
  for i in range(2,a):
      temp = fractions.gcd(temp,c[i])
  print(abs(temp))
else:
  print(abs(c[0]))
Buggy python submission (verdict: Runtime Error):
s = str(input())
        k = int(input())
        for i in s:
            if i != "1":
                print(i)
                break

Fixed submission:
S = input()
K = int(input())
 
if K == 1:
    print(S[0])
    exit()
else:
    for i in range(K):
        if S[i] != '1':
            print(S[i])
            exit()
print(1)
Buggy python submission (verdict: Runtime Error):
import sys

a = int(input())
b = int(input())
c = int(input())

if b - a == c - b:
    print('YES')
else:
    print('NO')

Fixed submission:
a,b,c = map(int, input().split())
print('YES') if b - a == c - b else print('NO')

Buggy python submission (verdict: Runtime Error):
a,b,c = int(input()), int(input()), int(input())

if b - a == c - a:
    print('YES')
else:
    print('NO')

Fixed submission:
a,b,c = map(int, input().split())
print('YES') if b - a == c - b else print('NO')
Buggy python submission (verdict: Runtime Error):
from collections import Counter as mset

n = int(input())
intersection = input()
for i in range(n - 1):
    intersection = intersection & mset(input())

print(''.join(sorted(list(intersection.elements()))))

Fixed submission:
from collections import Counter as mset

n = int(input())
inputs = []
for i in range(n):
    inputs.append(input())

intersection = mset(inputs.pop(0))

for w in inputs:
    intersection = mset(w) & intersection

print(''.join(sorted(list(intersection.elements()))))
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int, input().split()))
 
s = [list(map(int,input().split())) for i in range(n)]
c = [list(map(int,input().split())) for j in range(n)]
 
for t1 in s:
    l = list(map(lambda x: abs(t1[0] - x[0]) + abs(t1[1] - x[1]), c))
    print(l.index(min(l)) + 1)

Fixed submission:
a,b=map(int,input().split())
print((a + b) % 24)
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int, input().split()))
 
s = [list(map(int,input().split())) for i in range(n)]
c = [list(map(int,input().split())) for j in range(n)]
 
for t1 in s:
    l = list(map(lambda x: abs(t1[0] - x[0]) + abs(t1[1] - x[1]), c))
    print(l.index(min(l)) + 1)

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

s = []
for i in range(N):
    s.append(list(map(int, input().split())))

c = []
for j in range(M):
    c.append(list(map(int, input().split())))

for t1 in s:
    l = list(map(lambda x: abs(t1[0] - x[0]) + abs(t1[1] - x[1]), c))
    print(l.index(min(l)) + 1)
Buggy python submission (verdict: Runtime Error):
from math import sqrt

def F(t):
    return max(len(str(t[0])), len(str(t[1])))

N = long(input())
m = list(map(F,[(r,int(N / r)) for r in range(2, int(sqrt(N))) if N % r == 0]))
print(min(m)) if len(m) != 0 else print(len(str(N)))

Fixed submission:
from math import sqrt

def F(t):
    return max(len(str(t[0])), len(str(t[1])))

N = int(input())
m = list(map(F,[(r,int(N / r)) for r in range(2, int(sqrt(N)) + 1) if N % r == 0]))
print(min(m) if len(m) != 0 else len(str(N)))
Buggy python submission (verdict: Runtime Error):
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
z = input()
n = int(z) +1
print(l[n])

Fixed submission:
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
z = input()
n = int(z) - 1
print(l[n])

Buggy python submission (verdict: Runtime Error):
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
z = input()
print(l[z+1])

Fixed submission:
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
z = input()
n = int(z) - 1
print(l[n])
Buggy python submission (verdict: Runtime Error):
l=[1,2,3]
for i in range(2):
    l.remove(int(input))
print(l[0])

Fixed submission:
l=[1,2,3]
for i in range(2):
	l.remove(int(input()))
print(l[0])
Buggy python submission (verdict: Runtime Error):
a,b =list(map(int,input().split()))
import math
print(a*b//math.gcd(a,b))

Fixed submission:
a,b =list(map(int,input().split()))
def gcd(x,y):
	if max(x,y)%min(x,y)==0:return min(x,y)
	else:return  gcd(min(x,y),max(x,y)%min(x,y))
print(a*b//gcd(a,b))
Buggy python submission (verdict: Runtime Error):
from math import degrees,atan 
a,b,x=map(int,input().split())
print(math.degrees(math.atan(a*b*b/2*x)) if x <=a*a*b/2 else math.degrees(math.atan(2*b/a-2*x/a*a*a)))

Fixed submission:
from math import degrees,atan 
a,b,x=map(int,input().split())
print(degrees(atan((a*b*b)/(2*x))) if x <=a*a*b/2 else degrees(atan((2*b)/a-(2*x)/(a*a*a))))
Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
cnt=0
same_length=1
for i in range(len(s)-1):
	if s[i]==s[i+1]:
		same_length +=1
	else:
		cnt+=int(same_length//2)
		same_length=1
cnt+=int(same_length//2)
if s[0]==s[-1] and s[-1]!=s[-2] and s[0]!=s[1]:
	cnt+=1
print(cnt*k)

Fixed submission:
s=input()
k=int(input())
if len(s)==1:
	print(k//2)
	exit()
cnt=0
same_length=1
first=1
for i in range(len(s)-1):
 		 if s[i]==s[i+1]:
 		 	same_length+=1
 		 	if cnt==0:first+=1
 		 elif s[i]!=s[i+1]:
 		 	if cnt==0:s_left=first
 		 	cnt+=int(same_length//2)
 		 	same_length=1
if same_length==len(s):
	print(len(s)*k//2)
	exit()
s_right=same_length
cnt+=int(same_length//2)
if s[0]==s[-1] and s_left%2==1 and s_right%2==1:
	print(cnt*k+k-1)
else:
	print(cnt*k)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(_) for _ in input().split()]
ans=[]
for i in range(n):
	m=min(a)
	ans.append(str(a.index(m)+1))
	a[a.index(m)]=10**6
print(' '.join(ans))

Fixed submission:
n=int(input())
a=[int(_) for _ in input().split()]
ans=[0]*n
for i in range(n):
	ans[a[i]-1]=i+1
print(' '.join(map(str,ans)))
Buggy python submission (verdict: Runtime Error):
from heapq import heapify,heappop,heappush
n,m=map(int,input().split())#n:num m:ticket
a=[-int(_) for _ in input().split()]
a=heapify(a)
for i in range(m):
	heappush(a,heappop//2)
print(sum(a)*-1)

Fixed submission:
from heapq import heapify,heappop,heappush
n,m=map(int,input().split())#n:num m:ticket
a=[-int(_) for _ in input().split()]
heapify(a)
for i in range(m):
	num=heappop(a)*-1
	heappush(a,(num//2)*-1)
print(sum(a)*-1)

Buggy python submission (verdict: Runtime Error):
from collections import deque
n,m=map(int,input().split())#n:num m:ticket
a=[int(_) for _ in input().split()]
a=deque(a)
for i in range(m):
	a[a.index(max(a))]=max(a)//2
print(sum(a))

Fixed submission:
from heapq import heapify,heappop,heappush
n,m=map(int,input().split())#n:num m:ticket
a=[-int(_) for _ in input().split()]
heapify(a)
for i in range(m):
	num=heappop(a)*-1
	heappush(a,(num//2)*-1)
print(sum(a)*-1)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())#n:num m:ticket
a=[int(_) for _ in input().split()]
for i in range(m):
	a[a.index(max(a))]=max(a)//2
print(sum(a))

Fixed submission:
from heapq import heapify,heappop,heappush
n,m=map(int,input().split())#n:num m:ticket
a=[-int(_) for _ in input().split()]
heapify(a)
for i in range(m):
	num=heappop(a)*-1
	heappush(a,(num//2)*-1)
print(sum(a)*-1)
Buggy python submission (verdict: Runtime Error):
print(int(input())**３)

Fixed submission:
n=int(input())
print(n**3)
Buggy python submission (verdict: Runtime Error):
limit=int(input())
sum=((limit-1)*limit//2)
print(sum)

Fixed submission:
s=input()
t=input()
cnt=0
for i in range(3):
	if s[i]==t[i]:
		cnt+=1
		continue
	else:
		continue
print(cnt)
Buggy python submission (verdict: Runtime Error):
N=int(input())
h=list(map(int,input().split()))
cnt=[]
l=0

for n in range(1,N):
	if h[n-1]>=h[n]:
		l+=1
		if n==N-1:
			cnt.append(l)
			break
		continue
	elif h[n-1]<h[n]:
		cnt.append(l)
		l=0
		continue
print(max(cnt))

Fixed submission:
N=int(input())
h=list(map(int,input().split()))
cnt=[]
l=0

if N==1:
	print(0)
	exit()

for n in range(1,N):
	if h[n-1]>=h[n]:
		l+=1
		if n==N-1:
			cnt.append(l)
			break
		continue
	elif h[n-1]<h[n]:
		cnt.append(l)
		l=0
		continue
print(max(cnt))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
def input():return sys.stdin.readline()
n,k=[int(i) for i in input().split()]
h=[int(i) for i in input().split()]
dp=[float('inf')]*n
dp[0]=0
for i in range(1,n):
	dp[i]=min([dp[j]+abs(h[i]-h[j]) for j in range(max(0,i-k),i)])
print(dp[-1])

Fixed submission:
def flog2():
	import sys
	def input():return sys.stdin.readline()
	n,k=[int(i) for i in input().split()]
	h=[int(i) for i in input().split()]
	dp=[float('inf')]*n
	dp[0]=0
	for i in range(1,n):
		dp[i]=min([dp[j]+abs(h[i]-h[j]) for j in range(max(0,i-k),i)])
	print(dp[-1])
	
if __name__ == "__main__":
	flog2()

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[float('inf')]*n
dp[0]=0
for i in range(1,n):
	dp[i]=min([dp[j]+abs(h[i]-h[j]) for j in range(max(0,i-k),i)])
print(dp[-1])

Fixed submission:
def flog2():
	import sys
	def input():return sys.stdin.readline()
	n,k=[int(i) for i in input().split()]
	h=[int(i) for i in input().split()]
	dp=[float('inf')]*n
	dp[0]=0
	for i in range(1,n):
		dp[i]=min([dp[j]+abs(h[i]-h[j]) for j in range(max(0,i-k),i)])
	print(dp[-1])
	
if __name__ == "__main__":
	flog2()
Buggy python submission (verdict: Runtime Error):
 =int(input())
l =list(map(int,input().split()))
s =(sorted(l))
print(s[-1]-s[0])

Fixed submission:
A =int(input())
l =list(map(int,input().split()))
s =(sorted(l))
print(s[-1]-s[0])
Buggy python submission (verdict: Runtime Error):
n=int(input())
print(min(sum(map(int,str(a)))+sum(map(int,str(n-a))))) for a in range(1,n))

Fixed submission:
n=int(input())
val=10**5
for a in range(1,n):
	if sum(map(int,str(a)))+sum(map(int,str(n-a)))< val:
		val = sum(map(int,str(a))) + sum(map(int,str(n-a)))
print(val)
Buggy python submission (verdict: Runtime Error):
s=input()
t=count('o')
print(700+t*100)

Fixed submission:
s=input()
t=s.count('o')
print(700+t*100)
Buggy python submission (verdict: Runtime Error):
=list(map(int,input().split()))
N = l[0]
X = l[1]
list_m = [int(input()) for x in range(N)]
list_m.sort()
s = sum(list_m)
r = X - s
for i in range(10**5):
	r -= list_m[0]
	if r < 0:
		lim = i 
		break
print(N + lim)

Fixed submission:
l=list(map(int,input().split()))
N = l[0]
X = l[1]
list_m = [int(input()) for x in range(N)]
list_m.sort()
s = sum(list_m)
r = X - s
for i in range(10**5):
	r -= list_m[0]
	if r < 0:
		lim = i 
		break
print(N + lim)
Buggy python submission (verdict: Runtime Error):
n=int(input())
nl=[input() for i in range(n)]
m=int(input())
ml=[input() for i in range(n)]
nsl=list(set(nl))
mx=0
for x in range(len(nsl)):
	d=nl.count(nsl[x])-ml.count(nsl[x])
	if d>mx:mx=d
print(max(0,mx))

Fixed submission:
n=int(input())
nl=[input() for i in range(n)]
m=int(input())
ml=[input() for i in range(m)]
nsl=list(set(nl))
mx=0
for x in range(len(nsl)):
	d=nl.count(nsl[x])-ml.count(nsl[x])
	if d>mx:mx=d
print(max(0,mx))

Buggy python submission (verdict: Runtime Error):
from collections import*
c=Counter.most_common
n=int(input())
n_l =[int(input()) for i in range(n)]
m=int(input())
m_l =[int(input()) for i in range(m)]
d=n_l.c()[0][1]-m_l.c()[-1][1]
if d <=0:print(0)
else:print(d)

Fixed submission:
n=int(input())
nl=[input() for i in range(n)]
m=int(input())
ml=[input() for i in range(m)]
nsl=list(set(nl))
mx=0
for x in range(len(nsl)):
	d=nl.count(nsl[x])-ml.count(nsl[x])
	if d>mx:mx=d
print(max(0,mx))

Buggy python submission (verdict: Runtime Error):
from collections import*
c=Counter.most_common
n=int(input())
n_l =[input() for i in range(n)]
m=int(input())
m_l =[input() for i in range(m)]
d=n_l.c()[0][1]-m_l.c()[-1][1]
if d <=0:print(0)
else:print(d)

Fixed submission:
n=int(input())
nl=[input() for i in range(n)]
m=int(input())
ml=[input() for i in range(m)]
nsl=list(set(nl))
mx=0
for x in range(len(nsl)):
	d=nl.count(nsl[x])-ml.count(nsl[x])
	if d>mx:mx=d
print(max(0,mx))
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,X= [int(input()) for x in range(4)] 
ans = 0
for a in range(1<<A):
	for b in range(1<<B):
		for c in range(1<<C):
			if 500*a+100*b+50*c == X:
				ans += 1
print(ans)

Fixed submission:
A,B,C,X= [int(input()) for x in range(4)] 
print([500*a+100*b+50*c for c in range(C+1) for b in range(B+1) for a in range(A+1)].count(X))
Buggy python submission (verdict: Runtime Error):
n,y=map(int,input().split())
A,B,C=[-1,-1,-1]
f=True
for a in range(n+1):
	for b in range(n+1):
		if 10000*a+5000*b+1000*(n-a-b)==y and 0<=n-a-b<=n:
			A,B,C=[a,b,n-a-b]
			f=False
			break
	if f==False:
		break
print(A,B,C)

Fixed submission:
n,y=map(int,input().split())
A,B,C=[-1,-1,-1]
f=True
for a in range(n+1):
	for b in range(n+1):
		if 10000*a+5000*b+1000*(n-a-b)==y and 0<=n-a-b<=n:
			A,B,C=[a,b,n-a-b]
			f=False
			break
	if f==False:
		break
print(A,B,C)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N,A,B=list(map(int,input(),split())
print(sum(i for i in range(N)) if A <= sum(map(int,str(i))) <= B))           

Fixed submission:
N,A,B =map(int,input().split())
print(sum(i for i in range(N+1) if A <= sum(map(int,str(i))) <= B))

Buggy python submission (verdict: Runtime Error):
N,A,B =map(int,input().split())
print(sum(i for i in range(n+1) if A <= sum(map(int,str(i))) <= B))

Fixed submission:
N,A,B =map(int,input().split())
print(sum(i for i in range(N+1) if A <= sum(map(int,str(i))) <= B))

Buggy python submission (verdict: Runtime Error):
N,A,B = [map(int,input().split())]
print(sum(i for i in range(n+1)) if A <= sum(map(int,str(i))) <= B)

Fixed submission:
N,A,B =map(int,input().split())
print(sum(i for i in range(N+1) if A <= sum(map(int,str(i))) <= B))

Buggy python submission (verdict: Runtime Error):
N,A,B = [map(int,input().split())]
print(sum(i for i in range(n+1) if A <= sum(map(int,str(i))) <= B))

Fixed submission:
N,A,B =map(int,input().split())
print(sum(i for i in range(N+1) if A <= sum(map(int,str(i))) <= B))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
point = 0
while True:
	A =[x % 2 for x in a]
	if A.count(0) != N:
		break
	 = [x // 2 for x in a]
	point += 1
print(point)

Fixed submission:
s = input()
print(s.count('1'))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))
point = 0
while True:
	A =[x % 2 for x in a]
	if A.count(0) != len(a):
		break
	A = [x // 2 for x in a]
	point += 1
print(point)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
count = 0
flag = True
while flag:
    for i in range(len(a)):
        if a[i] % 2 == 1:
            flag = False
        else:
            a[i] //= 2
    count += 1
 
print(count - 1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
point = 0
while True:
	for i in range(len(a)):
		if a[i] % 2 == 1:
			break
		else:
			point += 1
			a[i] //= 2
	print(point-1)
    break

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
count = 0
flag = True
while flag:
    for i in range(len(a)):
        if a[i] % 2 == 1:
            flag = False
        else:
            a[i] //= 2
    count += 1
 
print(count - 1)
Buggy python submission (verdict: Runtime Error):
from collections import*
n,k=[int(i) for i in input().split()]
l=input().split()
a=Counter(l)
ca=a.most_common()
val=len(set(l))
s=0
if val < k:
	k=val
for i in range(k):
	s +=ca[i][1]
print(n-s)

Fixed submission:
from collections import*
n,k=[int(i) for i in input().split()]
l=input().split()
a=Counter(l)
ca=a.most_common()
val=len(set(l))
s=0
if val < k:
	k=val
for i in range(k):
	s +=ca[i][1]
print(n-s)
Buggy python submission (verdict: Runtime Error):
N = input()
sum=0
for i in range(len(N)):
	sum += int(i)
print('Yes' if int(N) // sum == 0 else 'No')

Fixed submission:
n = input()
print("Yes" if int(n) % sum(map(int,n)) == 0 else "No")

Buggy python submission (verdict: Runtime Error):
N = input()
sum=0
for i in range(int(N)):
	sum += int(i)
print('Yes' if int(N) // sum == 0 else 'No')

Fixed submission:
n = input()
print("Yes" if int(n) % sum(map(int,n)) == 0 else "No")

Buggy python submission (verdict: Runtime Error):
N = input()
sum=0
for i in range(int(N)):
	sum += int(i)
print('Yes' if int(N) // sum == 0 else 'No')

Fixed submission:
n = input()
print("Yes" if int(n) % sum(map(int,n)) == 0 else "No")