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 .

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

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

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

Solution (Python):
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))))

Solution (Python):
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)

Solution (Python):
(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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):
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())

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

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)

Solution (Python):
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)

Solution (Python):

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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

for i in range(N):

  D += L[i]
  if D > X:
    print (i+1)
    break
else:
  print (N+1)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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])

for i in range(n+1):
    if ans[n-i]<=x:
        a=n-i+1
        break

print(a)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
[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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
import math


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

a = int(inputa[0])
b = int(inputa[1])










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)

Solution (Python):
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]))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
n = raw_input()
input = n.split(" ")
n, x = input[0], input[1]
l = raw_input().split(" ")
current = 0
bounce = 1
for i in range(len(l)):
    current += int(l[i])
    if current <= int(x):
        bounce += 1
    else:
        break
print(bounce)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

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

Solution (Python):
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())

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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


cnt=0

ans=1

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

Solution (Python):
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))

Solution (Python):
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)

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

Solution (Python):


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

D = [0 for x in range(N+1)]

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

a = [x for x in D if x <= X]
ans = len(a)

print(ans)

Solution (Python):
n, x = map(int, input().split())
l = list(map(int, input().split()))
print(1+sum(x >= sum(l[:i+1]) for i in range(n)))

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

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

if sum(l) <= x:
    print(n+1)
    exit()

len = 0
for ind, ll in enumerate(l):
    len += ll
    if len > x:
        print(ind + 1)
        exit()

Solution (Python):
n,x=list(map(int, list(input().split())))
Ls=list(map(int, list(input().split())))
t=1
for i in range(n):
    if sum(Ls[:i+1]) > x:
        break
    t+=1
print(t)

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

Solution (Python):

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

Solution (Python):
nx=input().split()
l=input().split()

nx=[int(x) for x in nx]
l=[int(n) for n in l]

buf=0
count=1

for i in range(nx[0]):
    buf=buf+l[i]
    if nx[1]>=buf:
        count+=1

print(count)

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

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

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

    print(count)


main()

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

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

count = 1
sm = 0

for i in range(n):
    if (sm + l[i] <= x):
        count += 1
    sm += l[i]

print(count)

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

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

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

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

print(c+1)

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

Solution (Python):
import numpy as np

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)

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

D = 0
ans = N + 1
for i, v in enumerate (L, 1):
    D += v
    if D > X:
        ans = i
        break
    
print(ans)

Solution (Python):

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

sum = 0
count = 1
for l in ls:
    sum += l
    if sum <= x:
        count += 1

print(count)

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

z = [0]
for i in range(1, n+1):
    z += [z[i-1] + ls[i-1]]



count = 0
for c in z:
    if c <= x:
        count += 1

print(count)

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

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

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

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

count = 1
sigma = 0
for l in L:
    sigma += l
    if sigma > x:
        break
    else:
        count += 1
print(count)

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

for i in range(1, n):
    arr[i] += arr[i-1]
    
ans = 1
for elem in arr:
    if elem > x:
        break
    
    ans+=1

print(ans)

Solution (Python):

import sys

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

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

Solution (Python):
N,X=map(int,input().split())
L = list(map(int,input().split()))
a = 0
b = [0]
for i in range(N):
    a += L[i]
    b.append(a)
print(sum(1 for x in b if x <= X))

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

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

print(cnt)

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

d = [0]
acc = 0
for i in range(n):
    acc += l[i]
    d.append(acc)

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

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

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

print(a)

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

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

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

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

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

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

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

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

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

c = 1
d = 0

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

print(c)

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

Solution (Python):
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 cnt < n and current + l[cnt] <= x :
        current += l[cnt]
        cnt += 1
    
    print(cnt + 1)

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

Solution (Python):
import numpy as np
N, X = map(int, input().split())
a = list(map(int,input().split()))
cum_a = np.cumsum(a)
print(sum(x<=X for x in cum_a)+1)