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:
def bounding(N,X,L):
    d = 0
    for i in range(N+1):
        d = d + L[i]
        if d > X:
            return i + 1


if __name__ == '__main__':
    N, X = map(int,input().split())
    L    = list(map(int,input().split()))

    print(bounding(N,X,L))

Submission status: Runtime Error

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

D=[0]*(N-1)

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

Submission status: Runtime Error

Solution code:
n,x = map(int, input().split())
l = map(int, input().split())
#ボールの弾む座標
cnt=1
length=0
for i in range(n):
    length +=l[i]
    if length <=x:
        cnt+=1

print (cnt)

Submission status: Runtime Error

Solution code:
n,x = map(int, input().split())
l = map(int, input()/split())
#ボールの弾む座標
cnt=1
length=0
for i in range(n):
    length +=l[i]
    if length <=x:
        cnt+=1

print (cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X):
  D=D+L[i]
  i=i+1
if X=0:
  print(1)
else:
  print(i)

Submission status: Runtime Error

Solution code:
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X):
  D=D+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()))
count=0
length=0
while length<=X:
	length=length+L[count]
	count=count+1
print(count)

Submission status: Runtime Error

Solution code:
N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) <= X for x in range(len(L)+1)]
print(accumL.index(False))

Submission status: Runtime Error

Solution code:
N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) for x in range(len(L)+1)]
TF = [i <= X for i in accumL]
print(TF.index(False))

Submission status: Runtime Error

Solution code:
N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) for x in range(len(L)+1)]
TF = [i < X for i in accumL]
print(str(TF.index(False)+ 1))

Submission status: Runtime Error

Solution code:
N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) for x in range(len(L)+1)]
TF = [i < X for i in accumL]
print(TF.index(False) + 1)

Submission status: Runtime Error

Solution code:
N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) for x in range(len(L)+1)]
TF = [i < X for i in accumL]
print(TF.index(False))

Submission status: Runtime Error

Solution code:
N,X = map(int, input().split())
L = [map(int,input().split())]
accumL = []
for n in range(len(L)):
  accumL.append(sum(L[:n+1])
s = [x < 4 for x in accumL]
print(str(s.index(False) + 1))

Submission status: Runtime Error

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

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

    print(count)


main()

Submission status: Runtime Error

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

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

k = []
s = []
for i in range(n):
  k[i] += l[i]
  s[i] = k[i]

c = 0
for i in s:
  if i <= x:
    c += 1

print(c)

Submission status: Runtime Error

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

N=temp[0]
X=temp[1]

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

ind=1
while np.sum(L[:ind])<=X and ind<N:
  ind+=1
  
print(ind)

Submission status: Runtime Error

Solution code:
#
import sys

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

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

Submission status: Runtime Error

Solution code:
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
count = 0
for i, c in enumerate(l):
    count += c
    if count>x:
        p = i+1
        break
print(p)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

c = 0
d = 0

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

print(c)

Submission status: Runtime Error

Solution code:
def iread():
    return int(input())


def sread():
    return input()


def aread_int():
    tmp = input().split()
    ret = [int(i) for i in tmp]
    return ret


def aread_str():
    return input().split()

if __name__ == '__main__':
    n, x = map(int, input().split())
    l = aread_int()
    current = 0
    cnt = 0
    while current + l[cnt] <= x :
        current += l[cnt]
        cnt += 1
    
    print(cnt + 1)

Submission status: Runtime Error

Solution code:
N, X = (int(_) for _ in input().split())
L = list(map(int, input().split()))
D = 0
ans = 1
while (D < X or ans < N):
    D += L[ans - 1]
    ans += 1
if D == X:
    print(ans)
else:
    print(ans - 1)

Submission status: Runtime Error

Solution code:
N, X = (int(_) for _ in input().split())
L = list(map(int, input().split()))
D = 0
ans = 1
while (D < X or ans < N):
    D += L[ans - 1]
    ans += 1
    print(D, ans)
if D == X:
    print(ans)
else:
    print(ans - 1)

Submission status: Runtime Error

Solution code:
N, X = (int(_) for _ in input().split())
L = list(map(int, input().split()))
D = 0
ans = 0
while (D < X or ans < N):
    D = D + L[ans]
    ans += 1
if D == X:
    print(ans)
else:
    print(ans - 1)

Submission status: Runtime Error

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

D=[0, 0]
count=1
for n in range(N+1):
  D[1] = D[0] + L_i[n]
  if D[1] <= X:
    count += 1
    D[0] = D[1]
  else:
    break

print(count)

Submission status: Runtime Error

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

N += 1

sum = 0
count = 1

for i in range(N):
  sum = sum + L[i]
  count += 1
  if sum > X:
    count -= 1
    break
  if sum >= X:
    break
print(count)

Submission status: Runtime Error

Solution code:
n, x = (int(i) for i in input().split())  
l = list(int(_) for _ in input().split()) 
distance=0
_count=1
for i in range(0, n+1):
    distance += l[i]
    if distance<=x:
        _count += 1
print(_count)

Submission status: Runtime Error

Solution code:
n, x = (int(i) for i in input().split())  
l = list(int(_) for _ in input().split()) 
distance=0
_count=1
for i in range(0, n+1):
    distance += l[i]
    if distance<=x:
        _count += 1
    else:
        break
print(_count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0
for List in Lists:
    if count <= b:
        anser= anser + 1
        count = count + List
if a = 0:
    print("1")
else:
    print(anser)

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0
for List in Lists:
    if count <= b:
        anser= anser + 1
        count = count + List
if a = 0:
    print(1)
else:
    print(anser)

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0
for List in Lists:
    if count <= b:
        anser= anser + 1
        count = count + List
if a = 0:
print(1)
else:
print(anser)

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0
for List in Lists:
    if count <= b:
        anser= anser + 1:count = count + List
        


    print(anser)

Submission status: Runtime Error

Solution code:
n,x=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
ans=1
curr=0
ind=0
while(curr<=x):
    curr+=a[ind]
    ind+=1
    if(curr>x):
        break
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
c = list(map(int, input().split()))
d = 1
e = 0
for i in range(a):
    e += c[i]
    if e <= b:
        d += 1
print(d)
a, b = map(int, input().split())
c = list(map(int, input().split()))
d = 1
e = 0
for i in range(a):
    e += c[i]
    if e <= b:
        d += 1
    else:
        break
print(d)

Submission status: Runtime Error

Solution code:
i = input().split(" ")
n = int(i[0])
x = int(i[1])
l = input().split(" ")
height = 0
count = 0

while height <= x and count < n+1:
    height += int(l[count])
    count += 1

print(count)

Submission status: Runtime Error

Solution code:
i = input().split(" ")
n = int(i[0])
x = int(i[1])
l = input().split(" ")
height = 0
count = 0

while height <= x:
    height += int(l[count])
    count += 1

print(count)

Submission status: Runtime Error

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

D = 0
count = 1

for l in L:
    D += l

    if D <= X:
        count += 1

    else:
        breakXh

print(count)

Submission status: Runtime Error

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

In = list(map(int,input().split()))
distance = 0 
bound = 0
num = 0
while distance <= x :
    distance += In[num]
    num += 1
    bound += 1
print(bound)

Submission status: Runtime Error

Solution code:
def main15():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    data2 = input().split()
    num2 = []
    for i in range(num[0]):
        num2.append(int(data2[i]))
    length = 0
    result = 1
    for i in range(num[0]):
        length = length + num[2]
        if length > num[1]:
            break
        else:
            result = result + 1
    print(result)

if __name__ == "__main__":
    main15()

Submission status: Runtime Error

Solution code:
N = [int(i) for i in input().split()]
K = [int(i) for i in input().split()]
s = 0
c = 1
for i in K:
	if (i + s) <= N[1]
  		c += 1
      	s += i + s
	else
    	break
print(c)

Submission status: Runtime Error

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

cnt =0
pos =0
jp=[]
for i in range(n+1):
  if pos<=x:
    cnt +=1
    jp.append(pos)
    pos +=L[i]
  else:
    break

print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

L = [map(int,input().split())]

ans = int(1)
t = int(0)
for i in range(n):
    t += L[i]
    if t <= x:
        ans += 1

print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N,X= [int(s) for s in input().split()]
lst = [int(s) for s in input().split()]
dist=0
count=0
while(1):
  dist=dist+lst[count]
  if(dist>X or count==N):
    break
  count=count+1
print(count+1)

Submission status: Runtime Error

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

D = [0]#D1 = 0
for i in range(1,N+1):#座標Dの配列を作る
    Di = D[i-1] + L[i-1]
    D.append(Di)

for i in range(len(D)):#
    if D[i] == X:
        index = i
        break
    elif D[i] > X:
        index = i - 1
        break
ans = index + 1
print(ans)

Submission status: Runtime Error

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

D = [0]#D1 = 0
for i in range(1,N+1):#座標Dの配列を作る
    Di = D[i-1] + L[i-1]
    D.append(Di)

for i in range(len(D)):#
    if D[i] == X:
        index = i
        break
    elif D[i] > X:
        index = i - 1
        break
ans = index + 1
print(ans)

Submission status: Runtime Error

Solution code:
n,Xmax=map(int,input().split())
L=list(map(int,input().split()))
x=0
count=1
while x+L[0]<=Xmax:
  count+=1
  x+=L.pop(0)
print(count)

Submission status: Runtime Error

Solution code:
n,Xmax=map(int,input().split())
L=list(map(int,input().split()))
x=0
count=0
while x<Xmax:
  x+=L.pop(0)
  count+=1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

point = 0
cnt = 1
while point<=X:
  point += L[cnt-1]
  if point <= X:
    cnt += 1
  else:
    break

print(cnt)

Submission status: Runtime Error

Solution code:
n, x = list(map(int, input().split()))
li = list(map(int, input().split()))
d = []
d.append(0)
for l in li:
  d.append(d[-1] + l)
cnt = 0
for hoge in d:
  if(hoge <= d):
    cnt = cnt + 1
print(cnt)

Submission status: Runtime Error

Solution code:
n, x = list(map(int, input().split()))
li = list(map(int, input().split()))
d = []
d.append(0)
for l in li:
	d.append(d[-1] + l)
cnt = 0
for hoge in d:
  if(hoge <= d):
    cnt = cnt + 1
print(cnt)

Submission status: Runtime Error

Solution code:
import sys
N,X=(int(x) for x in input().split())

L=int(y) for y in input().split()
count = 0
D=[0]
for k in range(0,N+1):
  if(D(k)<=X):
    count += 1
  D.append(D(k)+L(k))
  
print(count)

Submission status: Runtime Error

Solution code:
import sys
N,X=(int(x) for x in input().split())
L=[]
L.append(int(y) for y in input().split())
count = 0
D=[0]
for k in range(0,N+1):
  if(D(k)<=6):
    count += 1
  D.append(D(k)+L(k))
  
print(count)

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
L = [int(x) for x in input().split()]
hop = 0
nextPos = 0
while nextPos <= X:
    nextPos += L[hop]
    hop += 1
print(hop)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input().split()
n=int(s[0])
x=int(s[1])
j=[]
d=input().split()
for i in range(n):
    j.append(int(d[i]))
d= 0
i=0
p=0
while d<=x:
    p+=1
    d+=j[i]
    i+=1
print(p)

Submission status: Runtime Error

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

kaisu = 0
dist = 0

while dist <= x:
  dist += l[kaisu]
  kaisu += 1
  
print(kaisu)

Submission status: Runtime Error

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

kaisu = 0
dist = 0

while dist <= x:
  dist += l[kaisu]
  kaisu += 1
  
print(kaisu + 1)

Submission status: Runtime Error

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

kaisu = 0
dist = 0

while dist <= x:
  dist += l[kaisu]
  kaisu += 1
  
print(kaisu)

Submission status: Runtime Error

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

while now <= x:
    now += 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
c=0
for i in range(1,n+2):
    if d<=x:
        c+=1
    d=d+L[i-1]
print(c)

Submission status: Runtime Error

Solution code:
N,X=list(map(int,open().split()))
i=list(map(int,open().split()))
listD=[0]
d=0

for s in i:
	d=d+s
	if d <= X:
		listD.append(d)
        
print(len(listD))

Submission status: Runtime Error

Solution code:
alfa=input()
N=int(alfa[0])
X=int(alfa[2])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Runtime Error

Solution code:
alfa=input()
N=int(alfa[0])
X=int(alfa[2])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Runtime Error

Solution code:
alfa=input()
N=int(alfa[0])
X=int(alfa[2])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Runtime Error

Solution code:
alfa=int(input())
L=[int(input()) for i in range(N)]

N=alfa[0]
X=alfa[2]

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

Submission status: Runtime Error

Solution code:
N=int(input())
X=int(input())
L=[int(input()) for i in range(N)]

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

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:
    count += 1
    D += L[i]
    i += 1
print(count)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, limit = map(int, input().split())
bounce = int(input().split())
b = [0]
count = 0
for i in range(len(bounce)):
  b.append(b[i]+bounce[i])
  
for j in range(len(b)):
  if b[j] <= limit:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
N, limit = map(int, input().split())
bounce = input().split()
b = [0]
count = 0
for i in range(len(bounce)):
  b.append(b[i]+bounce[i])
  
for j in range(len(b)):
  if b[j] <= limit:
    count += 1
print(count)

Submission status: Runtime Error

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

cur, index, ans = 0, 0, 0

while cur <= x:
    cur += ar[index]
    index += 1
    ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
N, limit = map(int, input().split())
bounce = input().split()
b = [0]
count = 0
for i in range(len(bounce)):
  b.append(bounce[i]+i)
  
for j in range(len(b)):
  if b[j] <= limit:
    count += 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+1):
  d[i+1] = d[i] + l[i]
  if d[i+1] > x:
    print(i+1)
    break

Submission status: Runtime Error

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

c = 0

for i in range(len(l)):
    if sum(L[:i+1]) <= x:
        c += 1
print(c)

Submission status: Runtime Error

Solution code:
oukei=0 
count=1

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

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

Submission status: Runtime Error

Solution code:
oukei=0 
count=1

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

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

Submission status: Runtime Error

Solution code:
x,a=map(int,input().split())
b=0
c=0
A=list(map(int,input().split()))
while b<=a:
    b=b+A[c]
    c+=1
print(c)

Submission status: Runtime Error

Solution code:
x,a=map(int,input().split())
b=0
c=0
A=[int(input()) for _ in range(x)]
while b<=a:
    b=b+A[c]
    c+=1
print(c)

Submission status: Runtime Error

Solution code:
x,a=map(int,input().split())
b=0
c=0
A = [int(input()) for _ in range(x)]
while b<=a:
    b=b+A[c]
    c+=1
print(c)

Submission status: Runtime Error

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


def main():
    n, x = map(int, input().split())
    lst = [input() for i in range(n)]
    print(n, x)
    print(lst)

    d = []
    for i in range(n + 1):
        if i == 0:
            d.append(0)
        else:
            d.append(d[i - 1] + int(lst[i - 1]))
    print(d)

    bound = 0

    for n, i in enumerate(d):
        if i <= x:
            bound += 1
        else:
            break
    print(bound)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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


def main():
    n, x = map(int, input().split())
    lst = [input() for i in range(n)]
    print(n, x)
    print(lst)
    
    d = []
    for i in range(n + 1):
        if i == 0:
            d.append(0)
        else:
            d.append(d[i - 1] + int(lst[i - 1]))
    print(d)
    
    bound = 0
    
    for n, i in enumerate(d):
        if i <= x:
            bound += 1
        else:
            break
    print(bound)




if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

ns=0
ans = 1

for i in range(n):
  ns += l[i]
  if ns <= x:
    ans++
  else:
    break
print(ans)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
l=[0]
for _ in range(n):
  l.append(int(input()))
cnt=0
sum=0
for i in range(n):
  sum+=l[i]
  if sum<=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
for i in range(n):
    d += l[i]
    if d > x:
        ans = i
        break
print(ans+1)

Submission status: Runtime Error

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

point = 0
count = 0
while point <= x:
    point = point + l[count]
    count += 1

print(count)

Submission status: Runtime Error

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

for i, d in enumerate(sp.cumsum(l)):
    if d > x:
        print(i+1)
        break
if sp.cumsum(l)[n] < x:
    print(n+1)

Submission status: Runtime Error

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

d = 0
count = 0
j = 0

while (d <= x) and (j <= len(l)):
  count = count + 1
  d = d + l[j]
  j = j + 1
  

if count < n+1:
  print(count)
else:
  print(n+1)

Submission status: Runtime Error

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

d = 0
count = 0
j = 0

while (d <= x) and (j <= range(len(l))):
  count = count + 1
  d = d + l[j]
  j = j + 1
  

if count < n+1:
  print(count)
else:
  print(n+1)

Submission status: Runtime Error

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

d = 0
count = 0
j = 0

while (d <= x) and (j < range(l)):
  count = count + 1
  d = d + l[j]
  j = j + 1
  

if count < n+1:
  print(count)
else:
  print(n+1)

Submission status: Runtime Error

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

d = 0
count = 0
j = 0

while d <= x:
  count = count + 1
  d = d + l[j]
  j = j + 1
  

if count < n+1:
  print(count)
else:
  print(n+1)

Submission status: Runtime Error

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

d = 0
count = 0
j = 0
while d <= x:
  count = count + 1
  d = d + l[j]
  j = j + 1
  

if count < n+1:
  print(count)
else:
  print(n+1)

Submission status: Runtime Error

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

d = 0
count = 0
j = 2

while i[j] < x:
  count =+ 1
  d = d + i[j]
  j =+ 1
  
  
print(count)

Submission status: Runtime Error

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

C=D=0
while C<X:
  D+=L[C]
  if D>X:
    break;
  C+=1
print(C+1)

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
a=list(map(int,input().split()))
i,s=0,0
while s<=x:
  s=s+a[i]
  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
cnt=1
for j in range(0,N+1):
    D=D+L[j]
    if D>X:
        break
    cnt+=1
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = list(map(int,input().split()))
N = s[0]
X = s[1]
L = list(map(int,input().split()))
a = 0
d = 0
while d <= X:
  if a >= N+1:
    break
  else:
    d += L[a]
    a += 1 

print(a)

Submission status: Runtime Error

Solution code:
s = list(map(int,input().split()))
N = s[0]
X = s[1]
L = list(map(int,input().split()))
a = 0
d = 0
while d <= X:
  if a == N+1:
    break
  else:
    d += L[a]
    a += 1 

print(a)

Submission status: Runtime Error

Solution code:
s = list(map(int,input().split()))
N = s[0]
X = s[1]
L = list(map(int,input().split()))
a = 0
d = 0
while d <= X:
  while a <= N+1:
    d += L[a]
    a += 1 

print(a)

Submission status: Runtime Error

Solution code:
s = list(map(int,input().split()))
N = s[0]
X = s[1]
L = list(map(int,input().split()))
a = 0
d = 0
while d <= X:
  if a >= N+1:
    a = N+1
    break
  d += L[a]
  a += 1 

print(a)

Submission status: Runtime Error

Solution code:
s = list(map(int,input().split()))
N = s[0]
X = s[1]
L = list(map(int,input().split()))
a = 0
d = 0
while d <= X:
  if a >= N+1:
    a = N
    break
  d += L[a]
  a += 1 

print(a+1)

Submission status: Runtime Error

Solution code:
s = list(map(int,input().split()))
N = s[0]
X = s[1]
L = list(map(int,input().split()))
a = 0
d = 0
while d <= X:
  d += L[a]
  a += 1 
  if a >= N+1:
    a = N+1
    break
print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, X_MAX=input().split()
L = input().split()
i = 0
X = 0

while int(X_MAX) >= X:
    X += int(L[i])
    i+=1
print(i)

Submission status: Runtime Error

Solution code:
N,X = [int(x) for x in input().split()] # N と　X
list_2 = [int(x) for x in input().split()]
 
sum_list = []
for i in list_2:
    if sum(sum_list) < X:
      sum_list.append(i)
    elif sum(sum_list) == X:
      print(len(sum_list) + 1)
      break
    elif sum(sum_list) > X:
      print(len(sum_list))
      break
if sum(sum_list) < X:
    print(list_1[0] + 1)