qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N,X=list(map(int,input().strip().split(' ')))
L=list(map(int,input().strip().split(' ')))
index=0
Bounce=[0]
for i in range(len(L)):
    
        
    Bounce+=[L[i]+Bounce[-1]]
    
count=0
for x in Bounce:
    if x<X:
        count+=1
print(count)

Fixed code:
N,X=list(map(int,input().strip().split(' ')))
L=list(map(int,input().strip().split(' ')))
index=0
Bounce=[0]
for i in range(len(L)):
    
        
    Bounce+=[L[i]+Bounce[-1]]
    
count=0
for x in Bounce:
    if x<=X:
        count+=1
print(count)
Buggy code:
N, X = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]

count = 1
d = [0] * (N+1)
for i in range(1, N+1):
    d[i] = d[i-1] + L[i-1]
    if d[i] <= X:count += 1

print(d)
print(count) 

Fixed code:
N, X = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]

count = 1
d = [0] * (N+1)
for i in range(1, N+1):
    d[i] = d[i-1] + L[i-1]
    if d[i] <= X:count += 1

print(count)
Buggy code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
cnt = 0
for i in l:
    if d <= x:
        d += i
        cnt+= 1
    
    else:
        cnt -= 1
        print(cnt)
    
print(cnt)
    

Fixed code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
cnt = 1
for i in l:
    d += i
    if d <= x:
        
        cnt += 1

print(cnt)
Buggy code:
[n,x]=[int(i) for i in input().split()]
l=[int(x) for x in input().split()]
a=0
su=0

for i in l:
    a+=1
    if su>x:
        
        break
    su+=i
   

print(a)




Fixed code:
[n,x]=[int(i) for i in input().split()]
l=[int(x) for x in input().split()]
a=1
su=0

for i in l:
    
    if su>x:
        
        break
    su+=i
    if su<=x:
        a+=1
   

print(a)
Buggy code:
def solve(n, x, l):
    ans = 1
    d = 0
    for i in range(n)
        d += l[i]
        if d <= x:
            ans += 1
    return ans
    
n, x = map(int, input().split())
l = list(map(int, input().split()))
print(solve(n, x, l))


Fixed code:
def solve(n, x, l):
    ans = 1
    d = 0
    for i in range(n):
        d += l[i]
        if d <= x:
            ans += 1
    return ans

n, x = map(int, input().split())
l = list(map(int, input().split()))
print(solve(n, x, l))
Buggy code:
N, X = map(int,input().split())
L = list(map(int,input().split()))

ans = 0
D = 0
for i in range(N + 1):
  if i == 0:
    ans += 1
  else:
    D += L[i - 1]
    ans += 1

print(ans)



Fixed code:
N, X = map(int,input().split())
L = list(map(int,input().split()))

ans = 0
D = 0
for i in range(N + 1):
  if i == 0:
    ans += 1
  else:
    D += L[i - 1]
    if D <= X:
      ans += 1
    else:
      break

print(ans)
Buggy code:
N, X = map(int, input().split())
positions = list(map(int, input().split()))


ans = 1
D = 0
for i in range(N + 1):
    if D + positions[i] < X:
        D += positions[i]
        ans += 1
    else:
        print(ans)
        exit()
print(ans)


Fixed code:
N, X = map(int, input().split())
positions = list(map(int, input().split()))


ans = 1
D = 0
for i in range(N):
    if D + positions[i] <= X:
        D += positions[i]
        ans += 1
    else:
        print(ans)
        exit()
print(ans)
Buggy code:
N , X = map(int,input().split())
L=list(map(int,input().split()))
b = 0
cnt = 1
for i in range(N):
    b += L[i]
    if b < X   :
        cnt+=1
    else:
        break
print(cnt)


Fixed code:
N , X = map(int,input().split())
L=list(map(int,input().split()))
b = 0
cnt = 1
for i in range(N):
    b += L[i]
    if b <= X   :
        cnt+=1
    else:
        break
print(cnt)
Buggy code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
list=[0]
cnt=0
for i in l:
  i=i+list[cnt]
  list.append(i)
  cnt+=1
print(list)
ans=0
for i in list:
  if i>=x:
    ans+=1
print(ans)
  
  
  

Fixed code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
list=[0]
cnt=0
for i in l:
  i=i+list[cnt]
  list.append(i)
  cnt+=1
ans=0
for i in list:
  if i<=x:
    ans+=1
print(ans)
Buggy code:
N, X = map(int, input().split())
l =list(map(int, input().split()))

d=[0]
for v in l:
    d.append(d[-1]+v)

print(len([_ for v in d if v <= X]))

Fixed code:
N, X = map(int, input().split())
l =list(map(int, input().split()))

d=[0]
for v in l:
    d.append(d[-1]+v)

print(len([v for v in d if v <= X]))
Buggy code:
n, x = map(int, input().split())
L = list(map(int, input().split()))
val = 0
count = 0

for l in L:
    val += l
    if val <= x:
        count += 1
print(count)

Fixed code:
n, x = map(int, input().split())
L = list(map(int, input().split()))
val = 0
count = 1

for l in L:
    val += l
    if val <= x:
        count += 1
print(count)
Buggy code:
# -*- coding: utf-8 -*-


from sys import stdin

############################################

# read data for n sequences.
temp = stdin.readline().split()
N = int(temp[0])
X = int(temp[1])

data = []
write = stdin.readline().split()
for i in range(N):
    data.append(int(write[i]))
    
count = 0
dis = 0

for d in data:
    if dis <= X:
        count += 1
        dis += 0
    else:
        break

print(count)

Fixed code:
# -*- coding: utf-8 -*-


from sys import stdin
import itertools



############################################

# read data for n sequences.
temp = stdin.readline().split()
N = int(temp[0])
X = int(temp[1])

data = []
write = stdin.readline().split()
for i in range(N):
    data.append(int(write[i]))
    
count = 1
dis = 0

for d in data:
    dis += d
    if dis <= X:
        count += 1
    else:
        break

print(count)
Buggy code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
ans = 0
for i in l:
 d += i
 ans += 1
 if d >= x:
  print(ans)
  exit()
print(ans)

Fixed code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
ans = 0
for i in l:
 ans += 1
 d += i
 if d > x:
  print(ans)
  exit()
print(ans+1)
Buggy code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
ans = 1
x = 0
for i in range(N):
  x += L[i]
  if x >= X:
    break
  else:
    ans += 1
print(ans)

Fixed code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
ans = 1
x = 0
for i in range(N):
  x += L[i]
  if x > X:
    break
  else:
    ans += 1
print(ans)
Buggy code:
n,x = input().split()
n,x = int(n), int(x)
L = [int(x) for x in input().split()]

D = [0 for _ in range(N)]

for i in range(1, N):
  D[i] = D[i-1] + L[i-1]

res = [True if D[i] <= x else False for i in range(N)]

print(sum(res))

Fixed code:
n,x = input().split()
n,x = int(n), int(x)
L = [int(x) for x in input().split()]

D = [0 for _ in range(n + 1)]

for i in range(1, n + 1):
  D[i] = D[i-1] + L[i-1]

res = [True if D[i] <= x else False for i in range(n + 1)]

print(sum(res))
Buggy code:
n,x=map(int,input().split())
L=list(map(int,input().split()))
ans=1
d=0
for l in L:
    if d+l<=x:
        d+=l
        print(d+l)
        ans+=1
    else:
        break
print(ans)


Fixed code:
n,x=map(int,input().split())
L=list(map(int,input().split()))
ans=1
d=0
for l in L:
    if d+l<=x:
        d+=l
        ans+=1
    else:
        break
print(ans)
Buggy code:
N, X = map(int, input().split())
L = list(map(int, input().split()))

D = 0
ans = 1

for i in L:
    D += i
    if D < X:
        ans += 1

print(ans)


Fixed code:
N, X = map(int, input().split())
L = list(map(int, input().split()))

D = 0
ans = 1

for i in L:
    D += i
    if D <= X:
        ans += 1

print(ans)
Buggy code:
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

# import numpy as np
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, X, *L = map(int, read().split())

Lcum = itertools.accumulate(L)

answer = sum(i < X for i in Lcum)
print(answer + 1)


Fixed code:
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

# import numpy as np
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, X, *L = map(int, read().split())

Lcum = itertools.accumulate(L)

answer = sum(i <= X for i in Lcum)
print(answer + 1)
Buggy code:
n,x=list(map(int,input().split()))
l=list(map(int,input().split()))
d=0
for i in range(n):
  d+=l[i]
  if d>x:
    print(i)
    break

Fixed code:
n,x=list(map(int,input().split()))
l=list(map(int,input().split()))
d=0
for i in range(n):
  d+=l[i]
  if d>x:
    print(i+1)
    break
else:
  print(n+1)
Buggy code:
N, X = map(int, input().split())
L = list(map(int, input().split()))

D = 0
num = 1

while num <= N+1:
  if D >= X:
    print(num)
    break
  D = D + L[num-1]
  num += 1
else:
  print(N)

Fixed code:
N, X = map(int, input().split())
L = list(map(int, input().split()))

D = 0
num = 1

while num <= N:
  D = D + L[num-1]
  if D > X:
    print(num)
    break
  num += 1
else:
  print(N+1)
Buggy code:
def main():
    n,x = map(int,input().split())
    l = list(map(int, input().split()))
    dist = 0
    count = 0
    for i in range(n):
        dist += l[i]
        if dist > x:
            break
        count += 1
    print(count)
    
if __name__ == "__main__":
    main()

Fixed code:
def main():
    n,x = map(int,input().split())
    l = list(map(int, input().split()))
    dist = 0
    count = 1
    for i in range(n):
        dist += l[i]
        if dist > x:
            break
        count += 1
    print(count)
    
if __name__ == "__main__":
    main()
Buggy code:
n,x=map(int,input().split())
a=list(map(int,input()split()))
count=0
for i in range(n):
  if sum(a[:i+1])<=x:
    count+=1
print(count)

Fixed code:
n,x=map(int,input().split())
a=list(map(int,input().split()))
sum=0
count=1
for i in range(n):
  sum+=a[i]
  if sum<=x:
    count+=1
print(count)
Buggy code:
N, X = list(map(lambda a: int(a), input().split(" ")))
L = list(map(lambda b: int(b), input().split(" ")))

i = 1
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

print(i)

Fixed code:
N, X = list(map(lambda a: int(a), input().split(" ")))
L = list(map(lambda b: int(b), input().split(" ")))

i = 0
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

if s <= X:
  i += 1

print(i)
Buggy code:
N, X = map(int, input().split())
L = [int(x) for x in input().split()]

D = [0] * (N+2)
for i in range(2, N+2):
    D[i] = D[i-1] + L[i-2]
    if D[i] > X:
        ans = i-1
        break

if D[-1] <= X:
    ans = N+1

print(ans)

Fixed code:
N, X = map(int, input().split())
L = [int(x) for x in input().split()]

D = [0] * 2
for i in range(2, N+2):
    D.append( D[i-1] + L[i-2] )
    if D[i] > X:
        ans = i-1
        break
if D[-1] <= X:
    ans = N+1

print(ans)
Buggy code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 0

for i in L:
    length += i
    counter += 1
    if length >= X:
        break
       
print(counter)


Fixed code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1

for i in L:
    length += i
    if length <= X:
        counter += 1
    
print(counter)
Buggy code:
N, X = map(int, input().split())
d=list(map(int, input().split()))

bound = 1
a = 0
for i in range(len(d)):
  a += d[i]
  if a >= X:
    break
  bound += 1
  
print(bound)

Fixed code:
N, X = map(int, input().split())
d=list(map(int, input().split()))

bound = 1
a = 0
for i in range(len(d)):
  a += d[i]
  if a > X:
    break
  bound += 1
  
print(bound)
Buggy code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
L=0
for i in range(n):
    L += l[i]
    if L >= x:
        print(i+1)
        exit()

Fixed code:
n,x = map(int, input().split())
l = list(map(int, input().split()))

d = 0
for i in range(n):
    d+=l[i]
    if d>x:
        print(i+1)
        exit()

print(n+1)
Buggy code:
# -*- coding: utf-8 -*-

N,X = list(map(int, input().rstrip().split()))
L_list = list(map(int, input().rstrip().split()))
#-----

D=0
ans = len(L_list) + 1

for i in range(N):
    D = D + L_list[i]
    if D > X:
        ans = i+1

print(ans)


Fixed code:
# -*- coding: utf-8 -*-

N,X = list(map(int, input().rstrip().split()))
L_list = list(map(int, input().rstrip().split()))
#-----

D=0
ans = len(L_list) + 1

cnt=1
for i in range(N):
    D = D + L_list[i]
    
    if D <= X:
        cnt += 1

print(cnt)
Buggy code:
a = input().split(" ")
l = input().split(" ")
x = int(a[1])
y = 0
num = 1
for i in l:
    y += i
    if y <= x:
        num += 1
    else:
        break
print(num)

Fixed code:
a = input().split(" ")
l = input().split(" ")
x = int(a[1])
y = 0
num = 1
for i in l:
    y += int(i)
    if y <= x:
        num += 1
    else:
        break
print(num)
Buggy code:
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = 0
count = 1
for i in L:
    D+=L
    if D<=X:
        count+=1
    else:
        break
print(count)

Fixed code:
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = 0
count = 1
for i in L:
    D+=i
    if D<=X:
        count+=1
    else:
        break
print(count)
Buggy code:
n,x= input().split()
b_list= list(map(int, input().split()))
temp = 0
counter = 0
for i in range(n):
    if (temp<=int(x)):
        counter +=1
    temp += b_list[i]

print(counter)

Fixed code:
n,x= input().split()
b_list= list(map(int, input().split()))
temp = 0
counter = 1
for i in range(int(n)):
    temp += b_list[i]
    if (temp<=int(x)):
        counter +=1
    else:
        break

print(counter)
Buggy code:
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    cnt = 1
    a = 0

    for i in range(len(L)):
        a += L[i]
        if a <= X:
            cnt += 1
    print(cnt)

Fixed code:
N, X = map(int, input().split())    
L = list(map(int, input().split()))
    
cnt = 1
    
a = 0

    
for i in range(len(L)):
    a += L[i]
    if a <= X:
        cnt += 1

print(cnt)
Buggy code:
_input1 = input()
_input2 = input()
N, X = tuple([int(a) for a in _input1.split(' ')])
l_list = [int(a) for a in _input2.split(' ')]

length = 0
cnt = 0

for l in l_list:
    if length > X:
        break
    length += l
    cnt += 1

if length > X:
    cnt += 1

print(cnt)


Fixed code:
_input1 = input()
_input2 = input()
N, X = tuple([int(a) for a in _input1.split(' ')])
l_list = [int(a) for a in _input2.split(' ')]

length = 0
cnt = 0

for l in l_list:
    if length > X:
        break
    length += l
    cnt += 1

if length <= X:
    cnt += 1

print(cnt)
Buggy code:
N, X = map(int, input().split())

L = list(map(int, input().split()))
D = 0
count = 0

for i in L:
    D += i
    if D <= X:
        count += 1
print(count)
  

Fixed code:
N, X = map(int, input().split())

L = list(map(int, input().split()))
D = 0
count = 1

for i in L:
    D += i
    if D <= X:
        count += 1
print(count)
Buggy code:
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(list(map(int,B.split( ))))
L_sum = 0
jump = 1
for i in range(N+1):
  L_sum += L[i]
  if(L_sum<X):
    jump += 1 
  else:
    jump += 0

print(jump)

Fixed code:
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(list(map(int, B.strip().split())))

L_sum = 0
jump = 1

for i in range(N):
  L_sum += L[i]
  if(L_sum>X):
    jump += 0
  else:
    jump += 1

print(jump)
Buggy code:
import numpy as np

n, x = map(int, input().split())
L = list(map(int, input().split()))

CS_L = np.cumsum(L).tolist()
ans = len([l for l in L if l <= x])
print(ans)

Fixed code:
import numpy as np

n, x = map(int, input().split())
L = list(map(int, input().split()))

CS_L = np.cumsum(L).tolist()
ans = len([l for l in CS_L if l <= x])
print(ans + 1)
Buggy code:
import numpy as np

if __name__ == "__main__":
    n,x = map(int, input().split())
    l = list(map(int, input().split()))
    d = []
    for i in range(n + 1):
        if i == 0:
            d.append(0)
        else:
            d.append(d[i-1] + l[i-1])

    answer_array = np.array(d) < x
    print(sum(answer_array))


Fixed code:
import numpy as np

if __name__ == "__main__":
    n,x = map(int, input().split())
    l = list(map(int, input().split()))
    d = []
    for i in range(n + 1):
        if i == 0:
            d.append(0)
        else:
            d.append(d[i-1] + l[i-1])

    answer_array = np.array(d) <= x
    print(sum(answer_array))
Buggy code:
n, x = (int(xi) for xi in input().split())
l = [int(xi) for xi in input().split()]

d=0

count = 0
for xi in range(n):
    if d<x:
        count +=1
    d += l[xi]

if d<x:
    count +=1

print(count)


Fixed code:
n, x = (int(xi) for xi in input().split())
l = [int(xi) for xi in input().split()]

d=0

count = 0
for xi in range(n):
    if d<x+1:
        count +=1
    d += l[xi]

if d<x+1:
    count +=1

print(count)
Buggy code:
n , x  = map(int , input().split())
L = (input().split())

cnt = 1
dis = 0
for i in range(n):
    dis = dis + int(L[i])
    print(dis)
    if dis <= x :
            cnt +=1

print(cnt)

Fixed code:
n , x  = map(int , input().split())
L = (input().split())

cnt = 1
dis = 0
for i in range(n):
    dis = dis + int(L[i])


    if dis <= x :
            cnt +=1

print(cnt)
Buggy code:
n,x=map(int, input().split())
l = list(map(int, input().split()))

d = [0]

for i in range(n):
	if d[i]+l[0]<=x:
		d.append(d[i]+l[0])
	else:
		break
print(len(d))


Fixed code:
n,x=map(int, input().split())
l = list(map(int, input().split()))

d = [0]

for i in range(n):
	if d[i]+l[i]<=x:
		d.append(d[i]+l[i])
	else:
		break
print(len(d))
Buggy code:
N, X = map(lambda x: int(x), input().split())
L = map(lambda x: int(x), input().split())
D = 0
count = 0
for i, l in enumerate(L):
if D <= X:
    count += 1
D += int(l)
print(count)

Fixed code:
N, X = map(int, input().split())
L = map(int, input().split())
D = 0
count = 1
for i, l in enumerate(L):
  D += l
  if D <= X:
      count += 1
print(count)
Buggy code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, X = mapint()
Ls = list(mapint())

now = 0
cnt = 0
for l in Ls:
    if now>X:
        break
    now += l
    cnt += 1
else:
    cnt += 1
print(cnt)

Fixed code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, X = mapint()
Ls = list(mapint())

now = 0
cnt = 0
for l in Ls:
    if now>X:
        break
    now += l
    cnt += 1
else:
    if now<=X:
        cnt += 1
print(cnt)
Buggy code:
# -*- coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

s = 0
count = 0
for i in range(N):
    if s <= X:
        s = s + L[i]
        count += 1
if s == sum(L):
    count += 1

print(count)

Fixed code:
# -*- coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

s = 0
count = 0
for i in range(N):
    if s <= X:
        s = s + L[i]
        count += 1

if s <= X:
    count += 1

print(count)
Buggy code:
N,X=map(int,input().split())
L=[int(x)for x in input().split()]

count=1
D=1
for i in range(0,N+1):
    if(D>X):
        break
    else:
        D=D+L[i]
        count+=1

print(count)

Fixed code:
N,X=map(int,input().split())
L=[int(x)for x in input().split()]

count=0
D=0
n=0
for i in range(0,N):
    n+=1
    if(D>X):
        break
    else:
        count+=1
        D=D+L[i]
    
if(n==N and D<=X):
    count+=1
print(count)
Buggy code:
n,x = map(int, input().split())
l = list(map(int, input().split()))
c = 0
d = []
d.append(0)

for i in range(n):
    d_next = d[i] + l[i]
    c = c + 1
    if d_next < x:
        break
    d.append(d_next)
print(c+1)

Fixed code:
n,x = map(int, input().split())
l = list(map(int, input().split()))
c = 0
d = []
d.append(0)

for i in range(n):
    if (d[i] + l[i]) > x:
        break
    d.append( (d[i] + l[i]) )
    c = c + 1
print(c+1)
Buggy code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
mem=0; ans=0
for i in L:
    if mem<X: ans+=1
    mem+=i
print(ans)

Fixed code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
mem=0; ans=1
for i in L:
    mem+=i
    if mem<=X: ans+=1
print(ans)
Buggy code:
n,x=map(int,input().split())
l=list(map(int,input().split()))

d=[0]
ans=0
for i in range(n):
    d.append(d[i-1]+l[i-1])
    if d[i]<=x:
        ans+=1
    else:
        ans+=0

print(ans)

Fixed code:
n,x=map(int,input().split())
l=list(map(int,input().split()))

d=[0]
ans=1
for i in range(1,n+1):
    d.append(d[i-1]+l[i-1])
    if d[i]<=x:
        ans+=1
    else:
        ans+=0

print(ans)
Buggy code:
import sys
def input(): return sys.stdin.readline().strip()

mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

N, X = mi()
L = li()

count = 0
D = 0
for i in range(N):
  D += L[i]
  if X >= D:
    count += 1
  else:
    break

print(count)

Fixed code:
import sys
def input(): return sys.stdin.readline().strip()
 
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))
 
N, X = mi()
L = li()
 
count = 1
D = 0
for i in range(N):
  D += L[i]
  if X >= D:
    count += 1
  else:
    break
 
print(count)
Buggy code:
N,X=map(int,input().split())
L=list(map(int,input().split()))

d=0
count=1
for l in L
 d=d+1
 if X>=d:
  count +=1
print(count)


Fixed code:
X,A = map(int,input().split())
L = list(map(int,input().split()))
 
d = 0
count = 1
for l in L:
    d = d + l
    if A>= d:
        count += 1
        
    
print(count)
Buggy code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
I=0
A=1
for i in L:
    I+=i
    if I<=X:
        A+=I
print(A)

Fixed code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
I=0
A=1
for i in L:
    I+=i
    if I<=X:
        A+=1
print(A)
Buggy code:
N,X = map(int, input().split())
L = list(map(int, input().split()))

distance = 0
for i in range(N+1):
  distance += L[i]
  if distance >= X:
    print(i+1)
    break

Fixed code:
N,X = map(int, input().split())
L = list(map(int, input().split()))

distance = 0
for i in range(N):
  distance += L[i]
  if distance > X:
    print(i+1)
    break
else: 
  print(N+1)
Buggy code:
N, X = map(int,input().split())
lst = list(map(int,input().split()))

cnt = 0
now = 0
for i in range(N):
    l = now + lst[i]
    cnt += 1
    if now > X:
        break
print(cnt)

Fixed code:
N, X = map(int,input().split())
lst = list(map(int,input().split()))

cnt = 1
now = 0
for i in range(N):
    l = now + lst[i]
    if l > X:
        break
    else:
        cnt += 1
        now = l
    

print(cnt)
Buggy code:
n,x=map(int,input().split())
Y = list(map(int,input().split()))
Z = [0]*n
a = 0
for i in range(n):
  a +=Y[i]
  Z[i]=a
import bisect
print(1+bisect.bisect_left(Z,x))

Fixed code:
n,x=map(int,input().split())
Y = list(map(int,input().split()))
Z = [0]*n
a = 0
for i in range(n):
  a +=Y[i]
  Z[i]=a
import bisect
print(1+bisect.bisect_left(Z,x+1))
Buggy code:
a,b=map(int, input().split())
list = input().split(' ')

s = 0
c = 0

for item in range(a):
    c += 1
    if (s + int(item)) <= b:
        s += int(item)
    else:
        break

print(c)

Fixed code:
a,b=map(int, input().split())
list = input().split(' ')

s = 0
c = 1

for item in list:
    if (s + int(item)) <= b:
        c += 1
        s += int(item)
    else:
        break

print(c)
Buggy code:
import itertools
import bisect

n, x = map(int, input().split())
ll = list(map(int, input().split()))

dl = [0] + list(itertools.accumulate(ll))

print(bisect.bisect_right(ll, x))

Fixed code:
import itertools
import bisect

n, x = map(int, input().split())
ll = list(map(int, input().split()))

dl = [0] + list(itertools.accumulate(ll))

print(bisect.bisect_right(dl, x))