Problem:


Score : 200 points

Problem Statement

A ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \leq i \leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.

How many times will the ball make a bounce where the coordinate is at most X?

Constraints

1 \leq N \leq 100

1 \leq L_i \leq 100

1 \leq X \leq 10000

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N X
L_1 L_2 ... L_{N-1} L_N

Output

Print the number of times the ball will make a bounce where the coordinate is at most X.

Sample Input 1

3 6
3 4 5

Sample Output 1

2

The ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.

Sample Input 2

4 9
3 3 3 3

Sample Output 2

4

The ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.



Sample input:
3 6
3 4 5


Sample output:
2

Submission status: Runtime Error

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0]*(N+1)
x = 0
for i in range(1,N+1):
  D[i] = D[i-1]+L[i-1]
while D[x] <= X:
  x += 1
print(x)

Submission status: Runtime Error

Solution code:
N,X = map(int, input().split())
l = list(map(int,input().split()))
count = 1
d = 0
for i in range(1,N):
  d = d + l[i]
  if d <= x:
    count += 1
print(count)

Submission status: Runtime Error

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

cnt = 0
d = 0
while True:
    d += l[cnt]
    cnt += 1
    if d > x or cnt > len(l):
        break
print(cnt)

Submission status: Runtime Error

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

def iter(d, idx):
    return d+l[idx]

cnt = 0
d = 0
while True:
    d = iter(d, cnt)
    cnt += 1
    if d > x:
        break
print(cnt)

Submission status: Runtime Error

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


cou = 0
BP = 0
for i in range(0, N + 1):
    if BP <= X:
        cou += 1
        BP += L[i]
    else:
        print(cou)
        exit()
print(cou)

Submission status: Runtime Error

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

D=0
count=1
while D<=X and count<=N+1:
   D=D+L[count-1]
   count+=1

print(min(N+1, count-1))

Submission status: Runtime Error

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

D=0
count=1
while D<=X:
   D=D+L[count-1]
   count+=1

print(min(N+1, count-1))

Submission status: Runtime Error

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

D=0
count=1
while D<=X:
   D=D+L[count-1]
   count+=1
print(count-1)

Submission status: Runtime Error

Solution code:
#B
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
count=1
for i in range(n+1):
    d = d + l[i]
    if d > x:
        break
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
z = 0
cnt = 0

while z<=X:
    z += L[cnt]
    cnt += 1

print(min(cnt, N+1))

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
z = 0
cnt = 0

while z<=X:
    z += L[cnt]
    cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
count = 0
d = 0
for i in range(1, n+2):
    d += l[i-1]
    if d <= x:
        count += 1
    else:
        break
print(count+1)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
li = list(map(int,input().split()))
count = 1
kyori
for i in li:
  kyori = kyori + i
  count += 1
  if kyori > x:
    break
print(count-1)

Submission status: Runtime Error

Solution code:
n,x=[int(x) for x in input().rstrip().split()]
l=[int(x) for x in input().rstrip().rsplit()]

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

Submission status: Runtime Error

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

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

tmp = 0
for i in range(100):
    tmp += l_list[i]
    if tmp > x:
        break

if tmp =< x:
    print(101)
else:
    print(i+1)

Submission status: Runtime Error

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

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

tmp = 0
for i in range(100000):
    tmp += l_list[i]
    if tmp > x:
        break

print(i+1)

Submission status: Runtime Error

Solution code:
N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
cnt=1
d=0
for i in L:
    d+=L[i]
    if d<=X:
        cnt+=1

print(cnt)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=0
count=0
i=0
while D<=X:
    count=count+1
    D=D+L[i]
    i=i+1
print(count)

Submission status: Runtime Error

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

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

i=2
D=0
while D <= X:
    D = D + L_list[i-2]
    ans = i-1
    i += 1

print(ans)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
b = list(map(int,input().split()))
cnt  = 0
ans = 0
while cnt<=x:
  cnt += b[ans]
  ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
def next_pos(D,L):
    return D+L
    
N, X = map(int,input().split(" "))
L = [int(i) for i in input().split(" ")]
D = 0
count = 0
i = 0

while(D<=X or i<N):
    D = next_pos(D,L[i])
    count+=1
    i+=1
    
print(count)

Submission status: Runtime Error

Solution code:
def next_pos(D,L):
    return D+L
    
N, X = map(int,input().split(" "))
L = [int(i) for i in input().split(" ")]
D = 0
count = 0
i = 0

while(D<=X):
    D = next_pos(D,L[i])
    count+=1
    i+=1
    
print(count)

Submission status: Runtime Error

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
zahyou = 0
count = 0

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

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=[0]
for i in range(n):
  d.append(d[-1]+l[i])
  if d[-1]>x:
    print(len(d)-1)
     break
  if i==n-1:
    print(n+1)

Submission status: Runtime Error

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

za = 0


for count in range(N):
  za += l[count]
  if za > X:
    break

print(count+1)

Submission status: Runtime Error

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

za = 0
count = 1

while za <= X:
  count += 1
  za += L[count-2]
  
print(count-1)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
listl = []
listl += map(int,input().split())
# print(listl)

cnt=1
d=0
# print(d)
for i in range(n):
    d = d+listl[cnt]
    if d > x:
        break
    # print(d)
    cnt+=1

print(cnt)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
listl = []
listl += map(int,input().split())
# print(listl)

cnt=0
d=0
# print(d)
while d <= x:
    d = d+listl[cnt]
    # print(d)
    cnt+=1

print(cnt)

Submission status: Runtime Error

Solution code:
import math
def main():
    t = [int(t)for t in input().split()]
    n,x = t[0],t[1]

    l = [int(t)for t in input().split()]

    i = 0
    s = 0
    while s<=x:
        s += l[i]
        i+=1

    print(i)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

s = 0
t = 0
for i in range(n+1):
  t += l[i]
  s += 1
  if t >= x:
    break
print(s)

Submission status: Runtime Error

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

s = 0
t = 0
for i in range(n+1):
  t += l[i]
  s += 1
  if t > x:
    break
print(s)

Submission status: Runtime Error

Solution code:
from itertools import accumulate
n,x = map(int, input().split())
a = [0, *map(int, input().split())]
print(len([i for i in accumulate(a) if i < x+1]))

Submission status: Runtime Error

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

L = [int(i) for i in range(N)]

D =[]
D[0]=0

for i in range(N):
  x += L[i]
  D.append(x)
  
  
print(D)

Submission status: Runtime Error

Solution code:
from itertools import accumlate
n,x = map(int,input().split())
lst_l = [0] + list(map(int,input().split()))
lst_wa = list(accumulate(lst_l))
cnt = 0
for i in lst_wa:
    if i < x:
        cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
import itertools
n,x = map(int,input().split())
lst_l = [0] + list(map(int,input().split()))
lst_wa = list(accumulate(lst_l))
cnt = 0
for i in lst_wa:
    if i < x:
        cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=0
e=0
f=1
while 1:
  d+=c[e]
  e+=1
  f+=1
  if d>=b:
    print(f)
    break
  else:
    pass

Submission status: Runtime Error

Solution code:
k, n = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
ct = 0
ans = 1
i = 0
while ct <= n:
  ct += l[i]
  ans += (ct <= n)
  i += 1
print(ans)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
l=list(map(int,input().split()))
d=0
cnt=1
while True:
    
    d+=l[cnt-1]
    if d>X:
        print(cnt)
        break
    cnt+=1
    
else:
    
    print(cnt)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
for i in range(N+1):
    if total<=X:
        total+=L[i]
        count+=1
print(count)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
for i in range(N+1):
    if total<=X:
        total+=L[i]
        count+=1
    else:
        break
print(count)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
i=0
while total<=X:
    if i<=len(L):
        total+=L[i]
        i+=1
        count+=1
    else:
        break
print(count)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
i=0
while total<=X:
    total+=L[i]
    i+=1
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
a=0
i=0
while d<x:
    d+=l[i]
    a+=1
    i+=1
if d==x:
    a+=1
print(a)

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
a=0
i=0
while d<=x:
    d+=l[i]
    a+=1
    i+=1
print(a)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
cur = ans = 0
while cur<=x and ans<=n:
    ans += 1
    cur += l[ans-1]
print(ans)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
i = 0

while True:
    ans = ans + l[i]
    if ans > x:
        break

    i += 1
    
print(i+1)

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
l = list(map(int, input().split()))
d = 0
answer = 0
for i in range(N+1):
    if d <= X:
        answer += 1
        d += l[i]
    else:
        break
print(answer)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D[0]=0
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  t=D[i-1]+L[i-1]
  D.append(t)
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  D.append((D[i-1]+L[i-1]))
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(len(D)):
  if D[j]<=X:
    s+=1
print(s)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D.append(0)
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=0
for j in D:
  if j<=X:
    s+=1
print(s)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
#i回目に跳ねる座標のリスト
D=[]
D.append(0)
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=count(j for j in D if j<=X)
print(s)

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
*l,=map(int,input().split())
cnt=1
d=0
while d <= x:
	d=d+l[cnt-1]
	cnt += 1
print(cnt-1)

Submission status: Runtime Error

Solution code:
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if s<=k: ans+=1
  else break
  s+=i
print(ans)

Submission status: Runtime Error

Solution code:
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if(s<=k) ans+=1
  else break
  s+=i
print(ans)

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d, i = l[0], 1
count = 1
while d <= x:
    d += l[i]
    count += 1
    i += 1
print(count)

Submission status: Runtime Error

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

d = [0]*(n+1)
for i in range(n):
    d[i+1] = d[i] + l[i]
    
ans = 0
for j in range(n+2):
    if d[j] <= x:
        ans += 1
    else:
        break

print(ans)

Submission status: Runtime Error

Solution 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)

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
i,d=0,0
while(x>d and i<=n+1):
  d+=l[i]
  i+=1
print(i)

Submission status: Runtime Error

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

cnt = 0
sum = 0

while sum <= X:
    sum += list[cnt]
    cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
def main():
    n,x = map(int, input().split())
    num_list = list(map(int, input().split()))

    count = 0
    sum = 0

    while(sum <= x):
        sum += num_list[count]
        count += 1

    print(count)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
cnt = 0
for i in range(N+2):
    if cnt <= X:
        cnt += L[i]
    else:
        print(i)
        break

Submission status: Runtime Error

Solution code:
def calcBoundCount(rangex, lstL):
    d = 0
    for i in range(0, len(lstL)):
        d = d + lstL[i]
        if rangex < d:
            return i + 1

N, X = map(int, input().split())
lstL = list(map(int, input().split()))

count = calcBoundCount(X, lstL)
print((count if count <= N+1 else N+1))

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
Len=[int(i) for i in input().split()]

test=0
for i in range(n):
  test+=Len[i]
  if test<=x:
    continue
  else:
    ans=i+1
    break
    
print(ans)

Submission status: Runtime Error

Solution code:
#python3
from itertools import count
n,x=map(int, input().split())
l=[int(i) for i in input().split()]
ans=0
d=0
for i in range(len(l)+1):
  if d>x: 
    break
  d=d+l[i]
  ans=i
print(i)

Submission status: Runtime Error

Solution code:
#python3
from itertools import count
n,x=map(int, input().split())
l=[int(i) for i in input().split()]
ans=0
d=0
for i in range(110):
  if d>x: 
    break
  d=d+l[i]
  ans=i
print(i)

Submission status: Runtime Error

Solution code:
#python3
from itertools import count
n,x=map(int, input().split())
l=[int(i) for i in input().split()]
ans=0
d=0
for i in count(0):
  if d>x: 
    break
  d=d+l[i]
  ans=i
print(i)

Submission status: Runtime Error

Solution code:
#python3
n,x=map(int, input().split())
l=[int(i) for i in input().split()]
cnt=0
d=0
while d<=x:
  d=d+l[cnt]
  cnt+=1
print(cnt)

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
for i in range(1,N+2):
    D += L[i-1]
    if D>X:
        print(i)
        exit()

Submission status: Runtime Error

Solution code:
n , x = map(int,input().split())
L =list(map(int,input().split()))
ans = 1
D = [0]*(n+1)
for i in range(2,n+2):
    D[i] = D[i-1] + L[i-2]
    if D[i] <=x:
        ans+=1
print(ans)

Submission status: Runtime Error

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

tmp = 0
cnt = 0
i = 0
while tmp <= x and i <= len(l):
    d = tmp + l[i]
    tmp = d
    cnt += 1
    i += 1

print(cnt)

Submission status: Runtime Error

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

tmp = 0
cnt = 0
i = 0
while tmp <= x:
    d = tmp + l[i]
    tmp = d
    cnt += 1
    i += 1

print(cnt)

Submission status: Runtime Error

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

s = 0
i = 1

while s <= X:
    s += L[i-1]
    i += 1

print(i-1)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

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

D = [0]
for l in L:
  d = D[-1] + L
  if d <= X:
    D.append(d)
  else:
    break

print(len(D))

Submission status: Runtime Error

Solution code:
N, X =map(int, input().split())
L = list(map(int, input().split()))
tmp=0
cnt=0

for i in range(N+1):
	if tmp <= X:
		cnt+=1
	else:
		break
	tmp+=L[i]
		
print(cnt)

Submission status: Runtime Error

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

D=L[0]
i=1
count=1

if D>X:
    print(0)
else:
    while D<=X and i<=N:
        D+=L[i]
        i+=1
        count+=1
    print(count)

Submission status: Runtime Error

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

D=0
i=0
count=0

while D<=X and i<=N:
    D+=L[i]
    i+=1
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
a=0
for i in range(n):
  a+=l(i)
  if a>x:
    print(i+1)
    break

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
p=1
dt=0
i=1
while dt<=X:
  dt=dt+L[i-1]
  i=i+1
  if dt<=X and p<=N+1:
    p=p+1
  #print(dt)
print(p)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
p=1
dt=0
i=1
while dt<=X:
  dt=dt+L[i-1]
  i=i+1
  if dt<=X:
    p=p+1
  #print(dt)
print(p)

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
List = list(input().split())

a = 0
b = [0]
for i in range(0, N):
  a = a + int(List[i])
  b.append(a)

d=[]
for i, c in enumerate(b, 1):
  if c > X :
    d.append(i-1)
    
print(d[0])

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
n,x=map(int,input().split())
A=list(map(int,input().split()))

count=0
sm=0
while sm<=x:
    count+=1
    sm+=A[count-1]

print(count)

Submission status: Runtime Error

Solution code:
N, X = list(map(int, input().split()))
bounds = list(map(int, input().split()))

zahyos = [0]
for i, bound in enumerate(bounds):
    zahyo = zahyos[i] + bound
    zahyos.append(zahyo)
    
cnt = 0
zahyo = 0
index = 0
while zahyo <= X:
    cnt += 1
    index += 1
    zahyo = zahyos[index]
    
print(cnt)

Submission status: Runtime Error

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

d = 0
ans = 0
for i in l:
    if d > x:
        break
    else:
        d += i
        ans += 1

if x > sum(d):
    ans += 1

print(ans)

Submission status: Runtime Error

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

D = 0
res = 0
while True:
    if D > X:
        break
    res += 1
    D += L[res-1] 

print(res)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
A=list(map(int,input().split()))
D=0
cnt=1
for i in range(X+1):
  D+=A[i]
  if D <= X:
    cnt+=1
  else:
    print(cnt)
    exit()

Submission status: Runtime Error

Solution code:
N,X = map(int,input().split())
arr = list(map(int,input().split()))
sumarr = np.cumsum(arr)
print(len(sumarr[sumarr<=X])+1)

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
dis = 0
ans = 0
while (dis <= x):
    dis += l[ans]
    ans += 1
print(ans)

Submission status: Runtime Error

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

count = 0
for i in range(n):
    if count > x:
        ans = i
        break
    elif i = n - 1:
        ans = n
        break
    else:
        count += l[i]
print(ans)

Submission status: Runtime Error

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

count = 0
for i in range(n - 2):
    if count > x:
        ans = i
        break
    else:
        count += l[i]
print(ans)

Submission status: Runtime Error

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

count = 0
for i in range(n - 1):
    if count > x:
        ans = i
        break
    else:
        count += l[i]
print(ans)

Submission status: Runtime Error

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

count = 0
for i in range(n):
    if count > x:
        ans = i
        break
    else:
        count += l[i]
print(ans)

Submission status: Runtime Error

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

count = 0
for i in range(n + 2):
    if count > x:
        ans = i
        break
    else:
        count += l[i]
print(ans)

Submission status: Runtime Error

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

count = 0
for i in range(n + 1):
    if count > x:
        ans = i
        break
    else:
        count += l[i]
print(ans)

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
L = list(map(int, input().split()))
c = 0
D = 0
for i in L:
  	c = c + 1
    D = D + i
    if D > x:
        print(c)
        exit()
if D > x:
  print(c)
else:
  print(c+1)

Submission status: Runtime Error

Solution code:
n, x = map(int,input().split())
L = list(map(int,input().split()))
coord = 0
B_c = 0
 
for i in range(N):
  coord = coord + L[i]
  if coord <= x:
    B_c = B_c + 1
  else:
    break

print(B_c)

Submission status: Runtime Error

Solution code:
n, x = map(int,input().split())
L = list(map(int,input().split()))
coord = 0
B_c = 0
 
for i in range(N):
  coord = coord + L[i]
  if coord <= x:
    B_c = B_c + 1
  else:
    break

Submission status: Runtime Error

Solution code:
n, x = int(input())
L = [0 for i in range(N)]
for i in raneg(N):
  L[i] = int(input())
  
coord = 0
B_c = 0

for i in range(N):
  coord = coord + L[i]
  if coord <= x:
    B_c = B_c + 1
  else:
    break
    
print(B_c)

Submission status: Runtime Error

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

wk = 0
for i in range(n):
    wk += l[i]
    #print(i)
    #print(l[i])
    if(wk > x):
        ans = i + 1
        break
print(ans)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
d,cnt=0,0
for i in range(1,N+2):
    if d<=X:
        d=d+L[i-1]
        cnt+=1
print(cnt)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
d,cnt=0,0
for i in range(1,N+2):
    if d>X:
        break
    d=d+L[i-1]
    cnt+=1
print(cnt)

Submission status: Runtime Error

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

d = 0
i = 0
while d <= X:
    d += L[i]
    i += 1
print(i)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0 for i in range(1, N+3)]
i=1
while i<=N+1:
    D[0]=0
    D[i]=D[i-1]+L[i-1]
    if D[i]>X:
        print(i)
        break
    i+=1

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0 for i in range(1, N+2)]
i=1
while i<=N+1:
    D[0]=0
    D[i]=D[i-1]+L[i-1]
    if D[i]>X:
        print(i)
        break
    i+=1

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
for i in L:
  D.append(D[-1]+i)
  if D[-1]>X:
    print(len(D)-1)
    break

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
l=[int(i) for i in input()split()]
a=0
ans=0
for i in l:
  if a+i>x:
    print(ans+1)
    exit()
  ans+=1
  a+=i
print(ans)

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=a.split()
d=b.split()
e=0
k=0
for i in range(len(d)):
        e+=int(d[i])
        k+=1
        if e>int(a[1]):
                break
print(k)

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=a.split()
d=b.split()
e=0
k=1
for i in range(len(d)):
        e+=int(d[i])
        k+=1
        if e>int(a[1]):
                break
print(k)

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
count = 0
location = 0
for i in range(N + 1):
    if location + L[i] <= X:
        count += 1
        location += L[i]
    else:
        break
print(count)

Submission status: Runtime Error

Solution code:
# ABC 130: B – Bounding
n, x = [int(s) for s in input().split()]
l = [int(s) for s in input().split()]

d = 0
times = 0

while d <= x and times <= n:
    d += l[times]
    times += 1

print(times)

Submission status: Runtime Error

Solution code:
# ABC 130: B – Bounding
n, x = [int(s) for s in input().split()]
l = [int(s) for s in input().split()]

d = 0
times = 0

while d <= x:
    d = d + l[times]
    times += 1

print(times)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main () {
    int n, x;
    cin >> n >> x;
    int count = 1;
    int sum = 0;
    int l;
    for (int i=0; i < n; i++) {
        cin >> l;
        sum += l;
        if (sum <= x) {
            count += 1;
        }
    }
    cout << count << endl;
}

Submission status: Runtime Error

Solution code:
n , x = map(int, input().split())
l = list(map(int, input().split()))
cnt = 0
s = 0
for i in range(l):
    s += i
    if s <= x:
        cnt += 1
    else:
        break

print(cnt)

Submission status: Runtime Error

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

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

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

Submission status: Runtime Error

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

dist, count = 0, 1
for i in range(n+1):
    dist += l[i]
    if dist > x:
        break
    count += 1

print(count)

Submission status: Runtime Error

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

dist, count = 0, 0
while dist <= x and count < n+1:
    dist += l[count]
    count += 1

print(count)

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
li = list(map(int, input().split()))
a = 0
i = 0
while a < x and i < n+1:
  a += li[i]
  i += 1
if a == x:
  i += 1
print(i)

Submission status: Runtime Error

Solution code:
nx = list(map(int, input().split()))
ln = list(map(int, input().split()))
n = nx[0]
x = nx[1]

dn = 0
count = 1
for i in range(0, n+1, 1):
    dn += ln[i]
    if dn > x:
        break
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
i=0
suml=0
if sum(l)<x:
    print(len(l))
else:
    while suml<=x:
        suml=suml+l[i]
        i=i+1
    print(i)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
i=0
suml=0
if sum(l)<x:
    print(len(l))
else:
    while suml<=x:
        suml=suml+l[i]
        i=i+1
        print(i)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
i=0
suml=0
while suml<=x:
    suml=suml+l[i]
    i=i+1
print(i)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
arr = list(map(int,input().split()))
chk = 0

for i in range(len(arr)-1):
    if i == 0:
        chk = 0
    else:
        chk = chk + arr[i]

    if chk <= x:
        count =+ 1
    else:
        print(count)
        exit()

 print(count)

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
i = 0
position = 0
cnt = 0
while position <= x:
    cnt += 1
    position += l[i]
    i += 1
print(cnt)

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
L = list(map(int, input().split()))
cnt = 0

for i in range(n+1):
    cnt += L[i]
    if cnt > x:
        print(i+1)
        exit()

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
L = list(input().split())
D = 1
l = [0]
if N == 1:
  print(1)
else:
  while max(l) < X:
    if int(l[-1]) + int(L[D - 1]) <= X:
      l.append(int(l[-1]) + int(L[D - 1]))
      D += 1
    else:
      break
  print(len(l))

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
L = list(input().split())
D = 1
l = [0]
while max(l) < X:
  if int(l[-1]) + int(L[D - 1]) <= X:
    l.append(int(l[-1]) + int(L[D - 1]))
    D += 1
  else:
    break
print(len(l))

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
l_array = [int(x) for x in input().split()]
d = 0
cnt = 1
for i in range(n+1):
    d = d + l_array[i]
    if d > x:
        break
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
l_array = [int(x) for x in input().split()]
d = 0
cnt = 0
while d <= x:
    d = d + l_array[cnt]
    cnt += 1
print(cnt)