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: Accepted

Solution code:
from itertools import accumulate


def solve(string):
    n, x, *l = map(int, string.split())
    return str(len(list(filter(lambda a: a <= x, list(accumulate(l))))) + 1)


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Submission status: Accepted

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

Submission status: Accepted

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

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

count=1

kazu=0

for i in hr :
    
    kazu += i 
    
    if kazu <= X:
        count +=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
s = 0
for num in nums:
    s += num
    if s <= x:
        count += 1
    else:
        break
print(count)

Submission status: Accepted

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

cnt = 1
current_x = 0
for i in range(n):
    current_x += l[i]
    if current_x <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x =map(int,input().split())
l1=list(map(int,input().split()))
l2=[0]
for i in range(n):
  l2.append(l2[i]+l1[i])
ans=0
i=0
while i<len(l2):
  if l2[i]<=x:
    ans+=1
  i+=1
print(ans)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
r=input().split()
count=1
d=0
for item in r:
  d+=int(item)
  #print(d,item)
  if d<=x:
    count+=1
  else:
    break
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution 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:
        break
    D.append(D[i]+L[i])
print(len(D))

Submission status: Accepted

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

d = 0
H = []

H.append(0)
for li in L:
    d = d + li
    H.append(d)

count = 0
for hi in H:
    if hi <= X:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n, x = [int(_) for _ in input().split()]
l = [int(_) for _ in input().split()]
bound = [0]

for i in range(n):
  bound.append(bound[i] + l[i])

print(sum(1 for _ in bound if _ <= x))

Submission status: Accepted

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

Submission status: Accepted

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

count=0
for i,j in enumerate(itertools.accumulate(L)):
    if X<j:
        count=i+1
        break
if count==0:
    count=len(L)+1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
n, x = map(int, input().split())
ls = []
count = 1
pos = 0
for l in map(int, input().split()):
    pos += l
    if (pos) > x:
        break
    else:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

c = 1
d = 0
for i in range(n[0]):
    d = l[c-1] + d
    if n[1] >= d:
        c = c + 1

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(x:int, l:list):
    cnt = 1
    now = 0
    for i in l:
        now += i
        if now <= x:
            cnt += 1
        else:
            break
    return cnt

def main():
    n, x = map(int, input().split(" "))
    l = list(map(int, input().split(" ")))
    print(solve(x, l))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
bound = list(map(int, input().split()))
bound.insert(0, 0)
ans = 0
bound_sum = 0
for i in bound:
  bound_sum += i
  if bound_sum > X:
    break
  else:
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect

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

D = [0]
for i in range(N):
  D.append(D[i]+L[i])
print(bisect.bisect_left(D,X+1))

Submission status: Accepted

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

D = 0
i = 0
while D<=X and i<N+1:
  #print('   {}'.format(D))
  if i<N:
	  D += L[i]
  i += 1
print(i)

Submission status: Accepted

Solution code:
lis = [0]
N, X = map(int, input().split())
L = input().split()
for i in range(N):
    lis.append(lis[i] + int(L[i]))
print(len(list(filter(lambda x: x <= X, lis))))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

a = 0
cnt = 0
for n in range(N):
    if a <= X:
       cnt = cnt + 1 

    a = a + L[n]

if a <= X:
    cnt = cnt + 1

print(cnt)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
L=[int(i)for i in input().split()]
a=0
c=1
for i in L:
    a+=i
    if a<=x:
        c+=1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, X=map(int, input().split())
L=list(map(int, input().split()))
L=[0]+L
 
l=int(0)
counter=int(0)
while l+L[counter]<=X and counter<=N:
  l+=L[counter]
  counter+=int(1)
  if counter==N+1:
    break
  
print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
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: Accepted

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

Submission status: Accepted

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

now = 0
count = 1
for i in range(n):
    now = now + L[i]
    if now <= x:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n, x = map(int, sys.stdin.readline().split())
llist =list(map(int, sys.stdin.readline().split()))

d = 0
ans = 1
for l in llist:
  ans += 1
  d += l
  if d > x:
    ans -= 1
    break
  elif d == x:
    break
  
  if ans >= n+1:
    print(n+1)
    exit()
print(ans)

Submission status: Accepted

Solution code:
import itertools


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

L = [0] + list(map(int, input().split()))
acc_L = list(itertools.accumulate(L))

res = len(list(filter(lambda x: x <= X, acc_L)))

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

cnt = 0
aaa = []
aaa.append(cnt)

for i in L_list:
    cnt += i
    aaa.append(cnt)

cnt_result = 0

for i in aaa:
    if X>= i:
        cnt_result +=1
    else:
        pass

print(cnt_result)

Submission status: Accepted

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

for i in range(n):
    d += l[i]
    if d > x:
        break
    else:
        cnt += 1

print(cnt)

Submission status: Accepted

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

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


dist = 0
cnt = 1
for n in range(N):
  dist += L[n]
  if dist > X:
    break
  else:
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
ls = list(map(int, input().split()))
cnt = 1
t = 0
for i in ls:
    t += i
    if t <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    test()

Submission status: Accepted

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

    D, i = 0, 0
    count = 1
    while i < N and D + L[i] <= X:
        count += 1
        D += L[i]
        i += 1
    return count

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

for t in L:
    dist += t
    if dist <= x:
        cnt += 1
    else:
        break
print(cnt)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
if n != 1:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x :
    if i == n:
      print(n+1)
      exit()
    ans += 1
    cnt += l[i]
    i += 1
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)

Submission status: Accepted

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

for i in l:
  d+=i
  if d<=x:
    ans+=1
  else:
    break
print(ans)

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n,x=na()
l=na()
l.append(0)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - Bounding(ABC130)
A=list(map(int, input().split()))
L=list(map(int, input().split()))
D=0
C=1
for i in L:
    D+=i
    if D<=A[1]:
        C+=1
    else:
        print(C)
        break
else:
    print(A[0]+1)

Submission status: Accepted

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

Submission status: Accepted

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

d = 0
for i, l in enumerate(input().split()):
  d += int(l)
  if d > x:
    print(i + 1)
    break
else:
  print(n + 1)

Submission status: Accepted

Solution code:
from sys import stdin
n, x = map(int, input().split())
l = [int(x) for x in stdin.readline().rstrip().split()]
cnt =[]
c=0
cnt.append(0)
for i in range(n):
	cnt.append(cnt[i]+l[i])


for i in range(n+1):
	if cnt[i] <= x:
		c+=1
print(c)

Submission status: Accepted

Solution code:
N, X = [int(x) for x in input().split()]
LN = [int(x) for x in input().split()]
p = 0
c = 1
while True:
  if p + LN[c-1] <= X:
    p += LN[c-1]
    c += 1
    if c > len(LN):
      break
  else:
    break
print(c)

Submission status: Accepted

Solution code:
N, X = map(int, input().rstrip().split())
li = [int(_) for _ in input().rstrip().split()]

count = 1
D = 0
for i in range(N):
    D = D + li[i]
    if D <= X:
        count += 1
    
print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

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

d = [0] + [0] * n
for i in range(n):
  d[i + 1] = d[i] + l[i]

ans = 0
for a in d:
  if a <= x:
    ans += 1

print(ans)

Submission status: Accepted

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

dis = 0
count = 1

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

print(count)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
lis=list(map(int,input().split()))
ans=[0]
for i in range(n):
    ans.append(ans[i]+lis[i])
#print(ans)
for i in range(n+1):
    if ans[n-i]<=x:
        a=n-i+1
        break

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

now = 0
ans = 1
for y in L:
    now += y
    if now <= x:
        ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
a = list(map(int, input().split()))
cnt = 1
t = 0
for i in a:
    t += i
    if t <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

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

d = 0
ans = 0
i = 1
while d <= x:
    ans += 1
    if ans == n+1:
        break
    d = d + l[i]
    i += 1

print(ans)

Submission status: Accepted

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

D = 0
res = N + 1
for i in range(N):
    D += Ls[i]
    if D > X:
        res = i + 1
        break

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
if n != 1:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x :
    if i == n:
      print(n+1)
      exit()
    ans += 1
    cnt += l[i]
    i += 1
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x=map(int, input().split())
List = list(map(int, input().split()))
su = 0
ans = 1
for i in range(n):
    su += List[i]
    if su > x:
        ans += i
        break;

if su <= x:
    ans += n

print(ans)

Submission status: Accepted

Solution code:
n,x,*l=map(int,open(0).read().split())
 
l.insert(0,0)
total=0
cnt=0
for l_ in l:
  total+=l_
  if x < total:
    break
  cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
n,x,*l=map(int,open(0).read().split())
 
l.insert(0,0)
total=0
arr=[]
for i, l_ in enumerate(l, start=1):
  total+=l_
  if total <= x:
    arr.append(total)
  else:
    break
print(len(arr))

Submission status: Accepted

Solution code:
n,x,*l=map(int,open(0).read().split())
l.insert(0,0)
arr=[]
total=0
for l_ in l:
  total += l_
  if x < total:
    break
  arr.append(total)
print(len(arr))

Submission status: Accepted

Solution code:
import math


inputa = input().split()
inputb = input().split()

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputList=[]
# for i in range(a):
#     inputNum = input()
#     inputList.append(inputNum)

listb = []
listb = [int(n) for n in inputb]

sum = 0
cnt = 0

for i in range(a):
    sum += listb[i]
    if sum <= b:
        cnt = i + 2
    else:
        break

print(cnt)

Submission status: Accepted

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

d=[0]
i=0
for item in l:
    d.append(item+d[i])
    i += 1

print(len([1 for j in d if j<=x]))

Submission status: Accepted

Solution code:
n,x=[int(i) for i in input().split()]
L=[int(i) for i in input().split()]
dlist=[0]
for l in L:
    dlist.append(dlist[-1]+l)
count=0
for d in dlist:
    if d<=x:
        count+=1
print(count)

Submission status: Accepted

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

L1=input().split()
L2=[]
for i in L1:
    L2.append(int(i))

c=1
d=0
for i in range(N):
    d+=L2[i]
    if d<=X:
        c+=1
    else:
        break

print(c)

Submission status: Accepted

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

cnt=1
dist=0

for l in L:
  dist+=l
  if dist>X:
    break
  cnt+=1
    
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
boundance,goal=map(int,input().split())
length = list(map(int,input().split()))
place=0
cnt=1

for x in range(len(length)):
    if place<goal:
        place+=length[x]
        if place<=goal:
            cnt+=1
        if place>goal:
            pass
    if place>=goal:
        pass
print(cnt)

Submission status: Accepted

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

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

coordinate = 0
count = 1
for l in lList:
    coordinate += l
    if coordinate <= x:
        count += 1

print(count)

Submission status: Accepted

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

d=0
D=[d]
for i in range(N):
    d=d+L[i]
    if d<=X:
        D.append(d)
    else:
        break
print(len(D))

Submission status: Accepted

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

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

Submission status: Accepted

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

bounds = 1
prev = 0
for i in range(1,N+1):
    bi = prev + L[i-1]
    prev = bi
    if bi > X:
        break
    else:
        bounds += 1

print(bounds)

Submission status: Accepted

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

Submission status: Accepted

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

pos=0
count=1
for i in range(1,n+1):
    pos+=l[i-1]
    if pos<=x:
        count+=1
    else:
        break

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

total = 0
cnt = 1

for l in L:
    total += l

    if total > X:
        break

    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
x,a = map(int,input().split())
l = list(map(int,input().split()))
res = [0]
for i in range(x):
    res.append(res[-1]+l[i])
ans = 0
for i in res:
    if i <= a:
        ans+=1
print(ans)

Submission status: Accepted

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

num = 0
for i in range(N+1):
    new_list = L[0:i]
    if sum(new_list) <= X:
        num += 1
    else:
        num += 0
print(num)

Submission status: Accepted

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

Submission status: Accepted

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

d = 0
k = 1
for i in L:
    d += i
    if d <= X:
        k += 1
    else:
        break
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

D = [0]*(n+1)
for i in range(n):
    D[i+1] = D[i]+L[i]
    if D[i+1] > x:
        print(i+1)
        break
    if i == n-1:
        print(n+1)

Submission status: Accepted

Solution code:
n, x = map(int,input().split())
L = list(map(int,input().split()))
D = [0]*(n+1)
cnt = 1

for i in range(n):
  D[i+1] = D[i] + L[i]
  if D[i+1]<=x:
    cnt+=1

print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = [0] * 1 
Dtemp = 0

for i in range(0, N):
	Dtemp = D[i] + L[i]
	if len(D) > N + 1:
		print(N + 1)
		exit()
	elif Dtemp > X:
		print(len(D))
		exit()
	else:
		D.append(Dtemp)

print(len(D))

Submission status: Accepted

Solution code:
def solve():
    n, x = map(int, input().split())
    L = list(map(int, input().split()))
    bounce = [0]
    pos = 0
    for i in L:
        pos += i
        bounce.append(pos)
    return len([b for b in bounce if b <= x])


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x = map(int, input().split())
l = list(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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
s=list(map(int,input().split()))
d=0
g=1
for l in s:
  d=d+l
  if d>X:
    break
  g+=1
print(g)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(n):
    bound+=l[i]
    if bound>x:
        print(i+1)
        sys.exit()
print(n+1)

Submission status: Accepted

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

#バウンド回数
cnt=0
#X以下の領域でボールが跳ねる回数
ans=1

for i in l:
  cnt += i
  if cnt <= x:
    ans += 1
  else:
    break
print(ans)

Submission status: Accepted

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)]
if accumL[-1] == True:
  print(N + 1)
else:
  print(accumL.index(False))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python

def main():
    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:
            return i+1
            break
    return i+2

if __name__ == '__main__':
    print(main())