Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())

for i in range(1, 10):
  if n % i ==0:
    if n/i < 10:
      print('Yes')
      brake
else:
  print('No')

Fixed submission:
n = int(input())

for i in range(1, 10):
  if n % i ==0:
    if n/i < 10:
      print('Yes')
      break
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
l.sort()
out = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    for k in range(j+1, n):
      if l[k] < l[i] + l[j]:
        out += 1
      else:
        break
print(out)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
out = 0
for i in range(n-2):
  k = i+2
  a = 1
  for j in range(i+1, n-1):
    a -= 1
    while k < n and l[k] < l[i] + l[j]:
      a += 1
      k += 1
    else:
      out += a
print(out)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = []

for i in range(1, n+1):
  b.append(a.index(i)+1)

print(' '.join(map(str, b)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0]*n

for i in range(n):
  b[a[i]-1] = i+1

print(' '.join(map(str, b)))
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = []
for i in range(q):
  a.append(int(input()))
  
for i in range(n):
  if k-q+a.count(i+1) > 0:
    print('Yes')
  else:
    print('No')

Fixed submission:
n, k, q = map(int, input().split())
point = [k]*n
for i in range(q):
  point[int(input())-1] += 1
for i in range(n):
  if point[i]-q > 0:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

a = 0
move = []

for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
  else:
    move.append(a)
    a = 0

print(max(move))

Fixed submission:
n = int(input())
h = list(map(int, input().split()))

a = 0
move = []

for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
  else:
    move.append(a)
    a = 0
move.append(a)

print(max(move))

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

a = 0
move = []

for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
  else:
    move += a
    a = 0

print(max(move))

Fixed submission:
n = int(input())
h = list(map(int, input().split()))

a = 0
move = []

for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
  else:
    move.append(a)
    a = 0
move.append(a)

print(max(move))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = ['']*n
for i in range(n):
  s[i] = (''.join(sorted(input())))
a = []

l = len(s)
while l > 0:
  i = s[0]
  s = [ss for ss in s if ss != i]
  t = l - len(s)
  if t != 1:
    a.append(t)
  l = l-t

ans = 0
for i in range(len(a)):
  ans += a[i]*(a[i]-1)//2
print(ans)

Fixed submission:
n = int(input())
s = ['']*n
for i in range(n):
  s[i] = (''.join(sorted(input())))
s.sort()

i=0
c=1
ans = 0
while i < n-1:
  while i+c < n and s[i] == s[i+c]:
    c += 1
  else:
    ans += c*(c-1)//2
    i += c
    c = 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
  s.append(''.join(sorted(input())))
a = []

l = len(s)
while l > 0:
  i = s[0]
  s = [ss for ss in s if ss != i]
  ll = len(s)
  a.append(l-ll)
  l = ll

ans = 0
for i in range(len(a)):
  ans += a[i]*(a[i]-1)//2
print(ans)

Fixed submission:
n = int(input())
s = ['']*n
for i in range(n):
  s[i] = (''.join(sorted(input())))
s.sort()

i=0
c=1
ans = 0
while i < n-1:
  while i+c < n and s[i] == s[i+c]:
    c += 1
  else:
    ans += c*(c-1)//2
    i += c
    c = 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
  s.append(''.join(sorted(input())))
a = []

while len(s) > 0:
  l = s[0]
  t = [ss for ss in s if ss != l]
  a.append(len(s)-len(t))
  s = t

ans = 0
for i in range(len(a)):
  ans += a[i]*(a[i]-1)//2
print(ans)

Fixed submission:
n = int(input())
s = ['']*n
for i in range(n):
  s[i] = (''.join(sorted(input())))
s.sort()

i=0
c=1
ans = 0
while i < n-1:
  while i+c < n and s[i] == s[i+c]:
    c += 1
  else:
    ans += c*(c-1)//2
    i += c
    c = 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
  s.append(''.join(sorted(input())))
a = []

while len(s) > 0:
  l = s[0]
  a.append(s.count(l))
  s = [ss for ss in s if ss != l]

ans = 0
for i in range(len(a)):
  ans += a[i]*(a[i]-1)//2
print(ans)

Fixed submission:
n = int(input())
s = ['']*n
for i in range(n):
  s[i] = (''.join(sorted(input())))
s.sort()

i=0
c=1
ans = 0
while i < n-1:
  while i+c < n and s[i] == s[i+c]:
    c += 1
  else:
    ans += c*(c-1)//2
    i += c
    c = 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
  s.append(sorted(input()))

ans = 0
for i in range(n-1):
  for j in range(i+1, n):
    if s[i] == s[j]:
      ans += 1
print(ans)

Fixed submission:
n = int(input())
s = ['']*n
for i in range(n):
  s[i] = (''.join(sorted(input())))
s.sort()

i=0
c=1
ans = 0
while i < n-1:
  while i+c < n and s[i] == s[i+c]:
    c += 1
  else:
    ans += c*(c-1)//2
    i += c
    c = 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split)

if a > b + c:
  print(0)
else:
  print(c+b-a)

Fixed submission:
a, b, c = map(int, input().split())

if a > b + c:
  print(0)
else:
  print(c+b-a)

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

if a > b + c:
  print(0)
else:
  print(c-b)

Fixed submission:
a, b, c = map(int, input().split())

if a > b + c:
  print(0)
else:
  print(c+b-a)
Buggy python submission (verdict: Runtime Error):
S = input()

if S[0] = S[1] and S[2] = S[3]
or S[0] = S[2] and S[1] = S[3]
or S[0] = S[3] and S[1] = S[2]:
  print(Yes)
else:
  print(No)

Fixed submission:
S = input()

if S[0] == S[1] == S[2] == S[3]:
  print('No')
elif S[0] == S[1] and S[2] == S[3]:
  print('Yes')
elif S[0] == S[2] and S[1] == S[3]:
  print('Yes')
elif S[0] == S[3] and S[1] == S[2]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0

i = 0
while d <= x:
  d += l[i]
  i += 1
print(i)

Fixed submission:
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0

i = 0
while d <= x and i <= n:
  if i < n:
    d += l[i]
  i += 1
print(i)
Buggy python submission (verdict: Runtime Error):
time = list(map(int, input().split()))

t = soated(time)

print(t[0]+t[1])

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

t = sorted(time)

print(t[0]+t[1])

Buggy python submission (verdict: Runtime Error):
p, q, r = map(int, input().split())

total = soated(p, q, r)

print(total[0]+total[1])

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

t = sorted(time)

print(t[0]+t[1])
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s=input()
if s[k-1] == 'A':
  s[k-1] = 'a'
elif s[k-1] == 'B':
  s[k-1] = 'b'
else:
  s[k-1] = 'c'
print(s)if s[k-1] == 'A':
  s[k-1] = 'a'

Fixed submission:
n, k = map(int, input().split())
s = list(input())
if s[k-1] == 'A':
  s[k-1] = 'a'
elif s[k-1] == 'B':
  s[k-1] = 'b'
else:
  s[k-1] = 'c'
print(''.join(s))
Buggy python submission (verdict: Runtime Error):
n, m, c=map(int, input().split())
b=list(map(int, input().split()))
ac=0
for _ in range(n):
  ans=c
  a=list(map(int, input().split()))
  for i in range(n):
    ans+=a[i]*b[i]
  if ans>0:
    ac += 1
print(ac)

Fixed submission:
n, m, c=map(int, input().split())
b=list(map(int, input().split()))
ac=0
for _ in range(n):
  ans=c
  a=list(map(int, input().split()))
  for i in range(m):
    ans+=a[i]*b[i]
  if ans>0:
    ac += 1
print(ac)
Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
i=0
while s[i]=='1' and i<len(s):
  i+=1
if k<=i or i==len(s):
  print(1)
else:
  print(s[i])

Fixed submission:
s=input()
k=int(input())
i=0
while i<len(s) and s[i]=='1':
  i+=1
if k<=i or i==len(s):
  print(1)
else:
  print(s[i])

Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
i=0
while s[i]=='1':
  i+=1
if k<=i or i==len(s):
  print(1)
else:
  print(s[i])

Fixed submission:
s=input()
k=int(input())
i=0
while i<len(s) and s[i]=='1':
  i+=1
if k<=i or i==len(s):
  print(1)
else:
  print(s[i])

Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
i=0
while s[i]=='1':
  i+=1
if k<=i:
  print(1)
else:
  print(s[i])

Fixed submission:
s=input()
k=int(input())
i=0
while i<len(s) and s[i]=='1':
  i+=1
if k<=i or i==len(s):
  print(1)
else:
  print(s[i])
Buggy python submission (verdict: Runtime Error):
n=input()
l=len(n)
if n==n[0]+'9'*(l-1):
  print(n[0]+9*(l-1))
else:
  print(9*(l-1)+int(n[0])-1)

Fixed submission:
n=input()
l=len(n)
if n==n[0]+'9'*(l-1):
  print(int(n[0])+9*(l-1))
else:
  print(9*(l-1)+int(n[0])-1)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0

for i in range(min(a, x//a)+1):
  for j in range(min(b, (x-500*i)//100)+1):
    p=x-500*i-100*j
    if p<=50*c:
      ans+=1
print(ans)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0

for i in range(min(a, x//500)+1):
  for j in range(min(b, (x-500*i)//100)+1):
    if x-500*i-100*j <= 50*c:
      ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
	while(y):
		x,y = y,x%y
	return x
k = int(input())
ans=0
for a in range(1,k+1):
	for b in range(1,k+1):
		for c in range(1,k+1):
			ans+=gcd(a,gcd(b,c))

print(ans)

Fixed submission:
def gcd(a,b):
	while(b):
		a,b = b,a%b
	return a
k = int(input())
ans=0
for a in range(1,k+1):
	for b in range(1,k+1):
		for c in range(1,k+1):
			ans+=gcd(a,gcd(b,c))

print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()

if a>+= 3200:
  print('red')
else:
  print(b)

Fixed submission:
a = int(input())
b = input()

if a>= 3200:
  print(b)
else:
  print('red')
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
if a =b or a=c or a=d or b =c or c = d or b= d:
  print("Good")
else:
  print("Bad")

Fixed submission:
n = int(input())
 
a = int(n/1000)
b = int(n/100) -a*10
c = int(n/10)-a*100 - b*10
d = n -a*1000-b*100-c*10
 
if a == b  or b ==c or c == d :
  print("Bad")
else:
  print("Good")

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

if a = b or a = c or a = d or b = c or b = d or c =d:
  print('Good')
else:
  print('Bad

Fixed submission:
n = int(input())
 
a = int(n/1000)
b = int(n/100) -a*10
c = int(n/10)-a*100 - b*10
d = n -a*1000-b*100-c*10
 
if a == b  or b ==c or c == d :
  print("Bad")
else:
  print("Good")
Buggy python submission (verdict: Runtime Error):
a = list(int(input()) for _  in range(5))
k = int(input())
ans='Yay!'
for i in a:
  for j in len(a):
    if a[j] - i >k:
      ans = ':('
print(ans)


Fixed submission:
a = list(int(input()) for _  in range(5))
k = int(input())
ans='Yay!'
for i in a:
  for j in range(len(a)):
    if a[j] - i >k:
      ans = ':('
print(ans)

Buggy python submission (verdict: Runtime Error):
a = list(int(input()) for _  in range(5))
k = int(input())
ans='Yay!'
for i in a:
  for j in len(a):
    if a[j] - i >18:
      ans = ':('
print(ans)

Fixed submission:
a = list(int(input()) for _  in range(5))
k = int(input())
ans='Yay!'
for i in a:
  for j in range(len(a)):
    if a[j] - i >k:
      ans = ':('
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
n_list = [map(int,input().split())]
ans = 0
for i in n_list:
  if i >=c and i <=a:
    ans+=1
    
print(ans)
  

Fixed submission:
a,b,c = map(int,input().split())
n_list = list(map(int,input().split()))
ans_1 = 0
ans_2 = 0

for i in n_list:
  if i >=c and i <=a:
    ans_1+=1
    
for i in n_list:
  if i >=0 and i <=c:
    ans_2+=1

print(min(ans_1,ans_2))
Buggy python submission (verdict: Runtime Error):
b_list = [int(input() for i in range(int(input())))]
r_list = [int(input() for i in range(int(input())))]

ans = 0 
for i in list(set(b_list)):
  s = b_list.count(i) - r_list.count(i)
  if ans <= s:
    ans = s
    
print(ans)


Fixed submission:
b_list = [input() for i in range(int(input()))]
r_list = [input() for i in range(int(input()))]

ans = 0 
for i in list(set(b_list)):
  if ans <= b_list.count(i) - r_list.count(i):
    ans = b_list.count(i) - r_list.count(i)
    
print(int(ans))

Buggy python submission (verdict: Runtime Error):
b_list = [int(input() for i in range(int(input())))]
r_list = [int(input() for i in range(int(input())))]

ans = 0 
for i in list(set(b_list)):
  if ans <= b_list.count(i) - r_list.count(i):
    ans = b_list.count(i) - r_list.count(i)
    
print(ans)

Fixed submission:
b_list = [input() for i in range(int(input()))]
r_list = [input() for i in range(int(input()))]

ans = 0 
for i in list(set(b_list)):
  if ans <= b_list.count(i) - r_list.count(i):
    ans = b_list.count(i) - r_list.count(i)
    
print(int(ans))
Buggy python submission (verdict: Runtime Error):
例
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
    else:
        continue
    
print(*answer)

Fixed submission:
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
    else:
        continue
    break
print(*answer)
Buggy python submission (verdict: Runtime Error):
a,b,c=input()
print(c+" "+a+""+b)

Fixed submission:
a,b,c= input().split()
print(c+" "+a+" "+b)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
if n>k and k>1:
    val=n-k
    print(n%val)
elif n>k and k==1:
	print(0)
else:
    val=k-n
    print(k%val)


Fixed submission:
n,k=map(int,input().split())

if k==1:
    print(0)
elif n>k:
    print(k-(n%k))
else:
    val=k-n
    if n<val:
        print(n)
    else:
        print(val)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
if n>k:
    n=n-k
    print(n%val)
else:
    print(n)


Fixed submission:
n,k=map(int,input().split())

if k==1:
    print(0)
elif n>k:
    print(k-(n%k))
else:
    val=k-n
    if n<val:
        print(n)
    else:
        print(val)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
if n>k:
    val=n-k
    print(n%val)
else:
    val=k-n
    print(k%val)


Fixed submission:
n,k=map(int,input().split())

if k==1:
    print(0)
elif n>k:
    print(k-(n%k))
else:
    val=k-n
    if n<val:
        print(n)
    else:
        print(val)
Buggy python submission (verdict: Runtime Error):
n,d=map(int,input().split())
if(d>=10){
print(1)
}else{
x=2*d+1
print(int(n/x)+1)
}


Fixed submission:
n,d=map(int,input().split())
x=2*d+1
if(n%x!=0):
    print(int(n/x)+1)
else:
    print(int(n/x))
Buggy python submission (verdict: Time Limit Exceeded):
N, *d = map(int, open(0).read().split())
m=d.index(max(d))
c=[max(d)] *N
  
for j in range(N):
    d[m]=0
    y=max(d)

c[m]=y
for i in range(len(c)):
    print(c[i])
 

Fixed submission:
N, *d = map(int, open(0).read().split())
m=d.index(max(d))
c=[max(d)] *N
d[m]=0
y=max(d)
c[m]=y
for i in range(len(c)):
    print(c[i])

Buggy python submission (verdict: Time Limit Exceeded):
N, *d = map(int, open(0).read().split())
m=d.index(max(d))
for i in range(N-1):
    if(i==m):
        temp=d[i]
        d[i]=0
        y=max(d)
        print(y)
        d[i]=temp
    
    print(max(d))

Fixed submission:
N, *d = map(int, open(0).read().split())
m=d.index(max(d))
c=[max(d)] *N
d[m]=0
y=max(d)
c[m]=y
for i in range(len(c)):
    print(c[i])

Buggy python submission (verdict: Time Limit Exceeded):
N, *d = map(int, open(0).read().split())
m=max(d)
for i in range(N):
    if(d[i]==m):
        temp=d[i]
        d[i]=0
        y=max(d)
        print(y)
        d[i]=temp     
    else:
        print(m)

Fixed submission:
N, *d = map(int, open(0).read().split())
m=d.index(max(d))
c=[max(d)] *N
d[m]=0
y=max(d)
c[m]=y
for i in range(len(c)):
    print(c[i])

Buggy python submission (verdict: Time Limit Exceeded):
N, *d = map(int, open(0).read().split())
for i in range(N):
    temp=d[i]
    d[i]=0
    print(max(d))
    d[i]=temp

Fixed submission:
N, *d = map(int, open(0).read().split())
m=d.index(max(d))
c=[max(d)] *N
d[m]=0
y=max(d)
c[m]=y
for i in range(len(c)):
    print(c[i])
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split())) 
d.sort()

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)+1]-d[int(len(d)/2)])

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

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)]-d[int(len(d)/2)-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split())) 

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)+1]-d[int(len(d)/2)])

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

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)]-d[int(len(d)/2)-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split())) 
print(len(d))

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)+1]-d[int(len(d)/2)])

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

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)]-d[int(len(d)/2)-1])
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=1
D=0
for i in range(n):
    if D>x:
        print(count)
        break
    else:
        D=D+L[i]     
        count+=1

Fixed submission:
n,a=map(int,input().split())
if n>=a:
    print(10)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=0
D=0
for i in range(n+1):
    if D>x:
        print(count)
        break
    else:
        D=D+L[i]     
        count+=1


Fixed submission:
n,a=map(int,input().split())
if n>=a:
    print(10)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=0
D=0
for i in range(n+2):
    if D<=x:
        D=D+L[i]     
        count+=1
    else:
        print(count)
        break

Fixed submission:
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=1
D=0
for i in L:
    D=D+i
    if D<=x:
        count+=1
    else:
        break
 
print(count)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=0
D=0
for i in range(n+1):
    if D<=x:
        D=D+L[i]     
        count+=1
    else:
        print(count)
        break

Fixed submission:
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=1
D=0
for i in L:
    D=D+i
    if D<=x:
        count+=1
    else:
        break
 
print(count)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=0
D=0
for i in range(n):
    if D>x:
        print(count)
        break
    elif D=0:
        count+=1
        print(count)
        break
    else:
        D=D+L[i]     
        count+=1


Fixed submission:
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=1
D=0
for i in L:
    D=D+i
    if D<=x:
        count+=1
    else:
        break
 
print(count)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=0
D=0
for i in range(n+1):
    if D>x:
        print(count)
        break
    else:
        D=D+L[i]     
        count+=1

    

Fixed submission:
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=1
D=0
for i in L:
    D=D+i
    if D<=x:
        count+=1
    else:
        break
 
print(count)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=0
D=0
for i in range(n+1):
    if D>x:
        print(count)
        break
    else:
        D=D+L[i]     
        count+=1

    

Fixed submission:
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=1
D=0
for i in L:
    D=D+i
    if D<=x:
        count+=1
    else:
        break
 
print(count)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
if k=0:
    print(0)
else:
    print(n-k)



Fixed submission:
n,k=map(int,input().split())
if k==1:
    print(0)
else:
    print(n-k)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
if(k=0){
print(0)
}
print(n-k)


Fixed submission:
n,k=map(int,input().split())
if k==1:
    print(0)
else:
    print(n-k)
Buggy python submission (verdict: Runtime Error):
A=input()
B=input()
C=input()
X=input()
total = 0
cnt = 0
 
for a in A+1:
  for b in B+1:
    for c in C+1:
      total = 500*a+100*b+50*c
      if total=X:
        cnt +=1
        
        
print(cnt)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
total = 0
cnt = 0
 
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      total = 500*a+100*b+50*c
      if total==X:
        cnt +=1
             
print(cnt)

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
x=input()
total = 0
cnt = 0

for i in a+1:
  for i in b+1:
    for i in c+1:
      total = 500*a+100*b+50*c
      if total=x:
        cnt +=1
        
        
print(cnt)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
total = 0
cnt = 0
 
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      total = 500*a+100*b+50*c
      if total==X:
        cnt +=1
             
print(cnt)
Buggy python submission (verdict: Runtime Error):
s=input().splitlines()
count = 0
if(s[0]==1):
    count+=1
if(s[1]==1):
    count+=1
if(s[2]==2):
    count+=1

print(count)

Fixed submission:
s=input()
print(s.count("1"))
Buggy python submission (verdict: Runtime Error):
n = input()
li = list(map(int,input().split())
cnt = 0
print(n)
print(li)

while True:
    for i in range(n):
        if li[i]%2 ==0:
            pass
        else:
            break

    for j in range(n):
        li[j]/=2

    cnt += 1

print(cnt)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
cnt = 0

while all(i%2==0 for i in li):
  for i in range(n):
    li[i]/=2
  cnt+=1

print(cnt)

Buggy python submission (verdict: Runtime Error):
n = input()
li = list(map(int,input().split())
cnt = 0

while True:
    for i in range(n):
        if li[i]%2 ==0:
            li[i]=li[i]/2
        else:
            break
        if(i==n-1):
            cnt += 1

print(cnt)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
cnt = 0

while all(i%2==0 for i in li):
  for i in range(n):
    li[i]/=2
  cnt+=1

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n= int(input())
A = list(map(int, input().split()))
count = 0
for i in range(len(A)):
    isMatch = True
    for j in range(i):
        if A[j] <= A[i]:
            isMatch = False
    if(isMatch):
        count = count + 1
print(count)


Fixed submission:
n= int(input())
A = list(map(int, input().split()))
count = 0
minVal = A[0]
for i in range(len(A)):
    if A[i] <= minVal:
        count = count + 1
        minVal = A[i]
print(count)
Buggy python submission (verdict: Runtime Error):
h = int(input())
w=  int(input())
n = int(input())


sum = 0
if h > w:
    for i in range(h):
        sum = sum + h
        if n <= sum:
            print(int(sum/h))
            break
else
    for i in range(w):
        sum = sum + w
        if n <= sum:
            print(int(sum/w))
            break



Fixed submission:
h = int(input())
w=  int(input())
n = int(input())


sum = 0
if h > w:
    for i in range(h):
        sum = sum + h
        if n <= sum:
            print(int(sum/h))
            break
else:
    for i in range(w):
        sum = sum + w
        if n <= sum:
            print(int(sum/w))
            break