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):
from itertools import accumulate as acc
n,x=map(int,input().split())
L=[0]+[int(i) for i in input().split()]

D=list(acc(L))
cnt=0
for i in D:
    if i<=x:
        cnt+=1
print(cnt)

Solution (Python):


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

h = 0  
f = 1

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

    if h > x:
        f = 0
        break

print(1+i+f)

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

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

print(cnt)

Solution (Python):
import itertools
N, X = [int(_) for _ in input().split()]
print(
    sum([
        1 for _ in list(
            itertools.accumulate([0] + [int(_) for _ in input().split()]))
        if _ <= X
    ]))

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

if sum(L) < X:
  print(N+1)
  exit()

for i in range(N):
  jumpNumber = jumpNumber + L[i]
  if jumpNumber > X:	
  	print(i+1)
  	break
  elif jumpNumber == X:
    print(i+2)
    break
  else:
    pass

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

Solution (Python):
a,b=map(int,input().split())
M = input()
l = M.split()
ll = list(map(int, l))
q=0
ans=1
for i in range(a):
  q += ll[i]
  if q <= b :
    ans += 1
print(ans)

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

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

d = 0

count=1

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

print(count)

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

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


plused = 0
count = 1
for v in l:
  plused += v
  if plused <= x:
    count += 1
  else:
    break

print(count)

Solution (Python):
n, x = (int(i) for i in input().split())

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

dis = 0
cnt = 1

for i in range(n):
	dis += l[i]
	cnt += 1
	if dis > x:
		cnt += -1
		break
        
print(cnt)

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

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

ans = 0
from itertools import accumulate
D = [0] + list(accumulate(L))
D_ = [d for d in D if d<=X]

print(len(D_))

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

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

count = 1
sum = 0

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

print(count)

Solution (Python):
N,X = map(int,input().split())
L = list(map(int,input().split()))
i = 0
while i <= N+1:
  s = 0
  s = sum(L[0:i])
  if s > X:
    print(i)
    break
  i += 1
else:
  print(i-1)

Solution (Python):
N, X = map(int, input().split())
t = list(map(int, input().split()))
p = 0
for i in range(N):
	p = p + t[i]
	if p > X:
		break
        
if p <= X:
	print(i+2)
else:
	print (i+1)

Solution (Python):
import sys
import math 
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()
N,X = na()

L = na()
c=1
tmp=0
for i in L:
    tmp += i
    if(tmp>X):
        break
    c+=1
print(c)

Solution (Python):

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

ans = 1
cur_X = 0
pos_N = 0

for i in range(N):
    ans += 1
    cur_X += L[i]

    if cur_X > X:
        ans -= 1
        break

print(ans)

Solution (Python):


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

l.insert(0,0)



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

print(ans)

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

now = 0
count = 1
for l in L:
    now += l
    if now > X:
        break
    else:
        count += 1

print(count)

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

d = 0
count = 0
if len(L) == 1:
    d += L[0]
    count += 1
    if d <= x:
        count += 1
    print(count)
else:
    for i in range(len(L)):
        d += L[i]
        count += 1
        if d > x:
            print(count)
            break
        if d == x:
            count += 1
            print(count)
            break
        if i+1 == len(L):
            if d <= x:
                count += 1
            print(count)

Solution (Python):
INPUT = list(map(int, input().split()))

N = INPUT[0]
X = INPUT[1]

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

vvv = 0
i = 0
while(vvv <= X):
    count += 1
    if(i >= N):
        break
    vvv += L[i]
    i += 1

print(count)

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

print(con)

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

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

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

    if a > int(x):
        print(i)
        flag = 1
        break

if flag == 0:
    print(int(n)+1)

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

d = 0
r = 0 

for l in L:
    d = d + l 
    if d > X: break
    r += 1

print(r+1)

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

length=0
count=1
for i in range(len(li)):
  length+=li[i]
  if length>x:
    break
  count+=1
print(count)

Solution (Python):
nx = [ int(x) for x in input().split(" ")]
ln = [ int(x) for x in input().split(" ")]
sum = 0
for i in range(nx[0]):
    sum += ln[i]
    if sum > nx[1]:
        break

if i == nx[0] - 1 and sum <= nx[1]:
    i += 1

print(i + 1)

Solution (Python):
N, X = map(int, input().split())
suu = [int(i) for i in input().split()]
flop,flag =0,1 

for i in range(N):
    flop += suu[i]
    if flop <= X:
        flag += 1

print(flag)

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

D=0
i=0
c=0
while D <= X:
    try:
        c+=1
        
        
        D+=l[i]
        i+=1
    except IndexError:
        break

print(c)

Solution (Python):
N, X = map(int, input().split())
li = list(map(int, input().split()))
D = [0]*(N+1)
flag = "0"
for i in range(N):
    D[i+1] = D[i] + li[i]
    if D[i+1] > X:
        flag = "1"
        break
if flag == "1":
    print(i + 1)
else:
    print(N + 1)

Solution (Python):
N,X = map(int,input().split())
L = [int(x) for x in input().split()]
L_cnt = 0
cnt = 1
for i in range(0,N):
  L_cnt += L[i]
  if L_cnt <= X:
    cnt += 1
  else:
    continue
print(cnt)

Solution (Python):
n,x=map(int,input().split())
l=[int(i) for i in input().split()]
h=0
ans=1
for i in l:
    ans+=1
    h=h+i
    if h>x:
        ans=ans-1
        break
print(ans)

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



s=0
cnt=1
ans=[]
for i in nums:
    s=s+i
    ans.append(s)

for i in ans:
    if i<=x:
        cnt+=1

print(cnt)

Solution (Python):
n,x= [int(i) for i in input().split()]
L=[int(i) for i in input().split()]
d=[0]
for i in range(1,len(L)+1):
    dd=d[i-1]+L[i-1]
    d.append(dd)
num=0
for j in range(len(d)):
    if d[j]<=x:
        num+=1
print (num)

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

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

print(count)

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

cnt = 0
before = 0
d = 0
L.insert(0, 0)



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

    if d <= X:
        cnt += 1

    
    before = d


print(cnt)

Solution (Python):

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



cnt = 0
x = 0
for length in L:
    
    if x <= X:
        cnt += 1
        x += length
    else:
        break
else:
    if x <= X:
        cnt += 1


print(cnt)

Solution (Python):
X,A = map(int,input().split())
li = list(map(int,input().split()))	

d=[0]*(X+1)

for i in range(1,X+1):
    d[i] = li[i-1] + d[i-1]

count = 0

for i in range (0,X+1):
    if d[i] <= A:
      count = count + 1 
    
print(count)

Solution (Python):
n,x=map(int,(input().split(' ')))
l=list(map(int,input().split(' ')))
count=1
sum1=0
for i in l:
    if sum1+i <=x:
        sum1+=i
        count+=1
    else:break
print(count)

Solution (Python):
def li():
    return list(map(int, input().split()))


if __name__ == "__main__":
    [n, x] = li()
    l_list = li()

    bound = 0
    bound_x = 0
    index = 0
    bound = bound + 1
    while bound_x + l_list[index] <= x:
        bound = bound + 1
        bound_x = bound_x + l_list[index]
        index = index + 1
        if index >= len(l_list):
            break

    print(bound)

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

Solution (Python):
i = raw_input().split(" ")
n,x = map(lambda s: int(s), i)
lst = raw_input().split(" ")

ans = 0
count = 1
for  s in lst:
    ans += int(s)
    if ans > x:
        break
    else:
        count += 1


print(count)

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

cnt = 1
snum = 0
for num in L:
    snum += num
    if snum <= X:
        cnt += 1
    else:
        break
print(cnt)

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

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

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

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

print(sum(res))

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

cnt = 0
D = 0
while D <= X and cnt < len(L):
    D += L[cnt]
    cnt += 1

if D <= X:
    cnt += 1

print(cnt)

Solution (Python):
n, x = input().split()
L = input().split()
for i, l in enumerate(L):
  if i == 0:
    D = int(l)
  else:
    D = int(l) + D

    
  if D > int(x):
    print(i + 1)
    break
    
if D <= int(x):
  print(int(n) + 1)

Solution (Python):
import sys

input = sys.stdin.readline

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

count = 1

current = 0

for l in l_list:
    current += l
    count += 1
    if current > x:
        break

if current > x:
    print(count - 1)
else:
    print(count)

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

print(ans)

Solution (Python):
N, X = map(int, input().split())
L = list(map(int, input().split()))
L.insert(0,0)
for i in range(1, len(L)):
    L[i] = L[i] + L[i-1] 
count = 0
for l in L:
    if l > X:
        break
    else:
        count += 1
print(count)

Solution (Python):
import numpy as np
N,X = map(int,input().split())
L = list(map(int,input().split()))
La = np.array(L)
Lcs = La.cumsum()
b_count = 1
for l in Lcs:  
  if X < l:
    break
  b_count += 1
print(b_count)

Solution (Python):
n,x=map(int,input().split(' '))
ls=map(int,input().split(' '))
c=1
d=0
for l in ls:
    d+=l
    if d<=x:
        c+=1
    else:
        break
print(int(c))

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

length = 0;
answer = 1;
i = 0;

while length + l[i] <= n[1]:
    length = length + l[i]
    answer = answer + 1
    if(len(l) == (i+1)):
        break;
    i = i + 1


print(answer)

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

def function(n,x,list):
  count = 1
  position = 0
  for l in list:
    position += l
    
    if position > x:
      break
    count += 1
   
  return count

print(function(n,x,l))

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

Solution (Python):
n, x = map(int,input().split())
L_list = list(map(int, input().split()))
total = 0
count = 1
for i in range(len(L_list)):
    total += L_list[i]
    if total <= x:
        count += 1
        continue
    else:
        break
print(count)

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

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

print(cnt)

Solution (Python):
in1 = list(map(int, input().split()))
N = in1[0]
X = in1[1]
 
L = list(map(int, input().split()))
L.append(0)
L.append(0)
D = 0
overflow = False
for i in range(1, N+2):
  if X < D:
    print(i-1)
    overflow = True
    break
  if X == D:
    print(i)
    overflow = True
    break
  D = D + L[i-1]

if not overflow:
  print(N+1)

Solution (Python):

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

L = input().split()
answer = 1
sum = 0
for n in range(N):
  sum += int(L[n])
  if sum <= X:
    answer += 1
print(answer)

Solution (Python):
import numpy as np

n, x = map(int, input().split())
l = np.array(list(map(int, input().split())))
s = np.zeros(n + 1)

for i in range(1, n + 1):
    s[i] = s[i - 1] + l[i - 1]

print(len(np.where(s <= x)[0]))

Solution (Python):
N,X=map(int,input().split())
L=list(map(int,input().split()))
T=0
if sum(L) <= X:
  print(N+1)
else:
  for l,i in zip(L,range(N)):
    T=T+l
    if T > X:
      print(i+1)
      break

Solution (Python):

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



cnt = 0
d = 0
curr = [0]
for n in range(N):
    if d <= X:
        cnt += 1
        d += L[n]
        curr.append(d)
    else:
        break
if d <= X:
    cnt += 1
print('{}'.format(cnt))

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

L = list(map(int,input().split()))
d = 0
ans = 0

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

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
    else:
        break
print(ans)

Solution (Python):
n,x = (int(x) for x in input().split())
l=list(map(int,input().split()))
k=0
d=0

while d<=x:
   if len(l)<=k:
    break
   else:
    d=d+l[k]
    k=k+1
if d<=x:
  print(k+1)
else:print(k)

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

count = 1
Sum = 0
while Sum <= X and count < N + 2:
    if count < N + 1:
        Sum += int(W.pop(0))
    count += 1
print(count-1)

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

count = 0
Di = 0
for i in range(nx[0]+1):

    if i != 0:
        Di += l[i-1]
    
    if Di > nx[1]:
        break
    
    count += 1
        
print(count)

Solution (Python):
import numpy as np

N, X = map(int, input().split())
a = np.fromstring(input(), dtype='i4', sep=' ')
ac = np.add.accumulate(a)
ans = np.searchsorted(ac, X, side='right')
print(ans + 1)

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

Solution (Python):


n, x = map(int,input().split())
length = input().split()

total_len = 0
for i in range(n):
    total_len += int(length[i])
    if total_len > x:
        print(i+1)
        break
    if i == n-1:
        print(n+1)

Solution (Python):
N, X = map(int, input().split())
L = [int(i) for i in input().split()]
step = [0]
nowstep = 0
ans = 0
i = 0

while i < N:
    step.append(nowstep + L[i])
    nowstep += L[i] 
    i += 1

for i in range(len(step)):
    if step[i] <= X:
        ans += 1
    else:
        pass

print(ans)

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

s = 0
pS = []
for i in range(N):
    s += List[i]
    pS.append(s)
    
pS = [0]+pS

if pS[-1]<=X:
    print(len(pS))
    
else:
    for j in range(N):
        if (pS[j]<=X)&(X<pS[j+1]):
            print(j+1)

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

Solution (Python):

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

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

print(ans+1)

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

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
    elif d > x:
        break
print(ans)

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

d = 0

truf = True

for a in range(n):
  d += l[a]
  if d > x:
    print(a+1)
    truf = False
    break

if truf:
  print(n+1)

Solution (Python):
n,x=map(int,input().split())
ln= list(map(int, input().split()))
result=[]
for i in range(0,100000):
    a=ln[:i]
    b=sum(a)
    result.append(b)
    if b>x:
        break
e=len(result)

if e>n+1:
    print(n+1)
else:
    print(e-1)

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

Solution (Python):
line1 = input().split()
n = int(line1[0])
x = int(line1[1])
L = list(map(int,input().split()))

d = 0
for i,l in enumerate(L):
	d += l	
	if d > x:
		print(i+1)
		break
	elif i==n-1:
		print(i+2)
		break

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

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

Solution (Python):
N, X = [int(item) for item in input().split()]
L = [int(item) for item in input().split()][::-1]
D = 0
count = 0
while D <= X:
  if len(L)>0:
    l = L.pop()
    D += l
    count += 1
  else:
    count += 1
    break
  
print (count)

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

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

Solution (Python):
import sys
n,x = list(map(int, input().split()))
l = list(map(int, input().split()))
isum = 0
for i in range(1,n+1):
    isum += l[i-1]
    if isum > x:
        print(i)
        sys.exit()
print(n+1 if sum(l) <= x else i)

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

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

Solution (Python):
n,x = map(int,input().split())
lst = list(map(int, input().split()))
score = 1
dp = 0
for i in range(n):
	if dp < x:
		dp += lst[i]
		score += 1
	elif dp == x:
		dp += lst[i]
		break
	else:
		score -= 1
		break
print(score)

Solution (Python):
s = input().split()
s = list(s)
s2 = input().split()
s2 = list(s2)
count=1
X = int(s[1])
count = 1
for i in s2:
    if i == ' ':
        continue
    X = X-int(i)
    if X < 0:
        break
    count += 1
print(count)

Solution (Python):

import sys;
import string;
sys.setrecursionlimit(20000) 

import copy
import itertools

from functools import lru_cache


PPP = 1000000007






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


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





















import re

def doit():
  p = 0
  res = 1
  for lx in l:
    p += lx
    if x < p:
      break
    res += 1
  
  return res



try:
  print(doit())
except Exception as e:
  print("e", e, file=sys.stderr)

Solution (Python):
n,x = map(int, input().split())
l = [0] + list(map(int, input().split()))
d = 0
i = 0
c = 0
while d <= x:
  d += l[i]
  i += 1
  if n+1 == i and d <= x:
    c = 1
    break
if c == 1:
  print(n+1)
else:
  print(i-1)

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

Solution (Python):
import numpy as np

A = input()
B = input()

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

L_sum = 0
jump = 1

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

print(jump)

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

dist = 0
num = 1

for (i, v) in enumerate(L):
  dist += v
  if dist <= x:
    num += 1
    continue
  else:
    break
    
print(num)

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




a=0
count=1
for i in range(len(L)):


    a+=L[i]

    if(a<=X):

        count+=1
print(count)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    n, x = [int(i) for i in input().split()]
    l_list = [int(i) for i in input().split()]
    n += 1
    d = 0
    num = 1
    for i in range(1, n):
        d = d + l_list[i - 1] * (i <= n + 1)
        if d > x:
            break
        num += 1
    print(num)


if __name__ == "__main__":
    main()

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

Solution (Python):
from sys import exit
n,x=map(int,input().split())

l=tuple(map(int,input().split()))
d=[0 for i in range(n+2)]


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

Solution (Python):
a = input().split()
n = int(a[0])
x = int(a[1])
l_str_list = input().split()
d = 0
answer = n + 1

for i in range(n):
  d += int(l_str_list[i])
  if d > x:
    answer = i + 1
    break
  if d == x:
    answer = i + 2
    break
print(answer)

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

for num in range(N + 1):
    if num > 0:
        D = D + list[num - 1]
    if D <= X:
        count += 1
print(count)

Solution (Python):
import sys

readline = sys.stdin.readline

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

p = 0
count = 0

if p <= X:
    count += 1

for l in L:
    p += l
    if p <= X:
        count += 1
    else:
        break

print(count)

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

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

print(ans)

Solution (Python):
def main():
    N, X = [int(n) for n in input().split()]
    L = [int(n) for n in input().split()]
    now = 0
    res = 0
    for i in range(N):
        if now <= X:
            res += 1
        now += L[i]
    if now <= X:
        res += 1
    print(res)
main()

Solution (Python):
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
N = a[0]
X = a[1]
L = []
for i in range(len(b)):
    L.append(b[i])
list=[]
D=[]
D.append(0)
for l in range(1,N+1):
    c = D[l-1] + L[l-1]
    D.append(c)

for j in range(len(D)):
    if D[j] <= X:
        list.append(1)

print(len(list))

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
N,X = map(int,input().split())

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


res = 0
i = 0
ans = 1
for i in range(N):
    res += li[i]
    ans += 1
    if res > X:
        ans -= 1
        break
print(min(ans,N+1))

Solution (Python):
def sol(inp=input):
    n,x=map(int,inp().split())
    ls=list(map(int,inp().split()))
    cumsum=0
    for i,l in enumerate(ls):
        cumsum+=l
        if cumsum>x:
            return (i+1)
    else: return n+1
print(sol())

Solution (Python):
n,x=map(int,input().split())
ans=0
oh=0
l=[int(i) for i in input().split()] 
for j in l:
  if x>=oh:
    ans+=1
  oh+=j
if sum(l)<=x:
    print(ans+1)
else:
  print(ans)

Solution (Python):
import bisect
from operator import itemgetter
import math
import collections
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()


N,X = IL()
L = IL()

tmp = 0
cnt = 1
for i in L:
  tmp += i
  if tmp <= X:
    cnt += 1

print(cnt)

Solution (Python):
N, X = map(int,input().split())
L = []
L = list(map(int, input().split()))
D = 0
Dtmp = 0
cnt = 1

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

print(cnt)

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

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

print(ans)

Solution (Python):
a=list(map(int,input().split()))
L=list(map(int,input().split()))
N=a[0]
X=a[1]
l=[0]
n=0
n1=0
while True:
    l.append(L[n]+l[n])
    n=n+1
    if n==N:
        break
while True:
    if l[n1]<=X:
        n1+=1
    else:
        print(n1)
        break
    if n1==N:
        if X>=l[-1]:
            print(n1+1)
            break
        else:            
            print(n1)
            break

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

Solution (Python):
n, x = list(map(int, input().split()))
L = list(map(int, input().split()))
posi = 0;cnt = 1;

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

Solution (Python):
n,x=map(int,input().split())
ls=map(int,input().split())
d = 0
c = 1
for li in ls:
    d += li
    if d <= x:
        c += 1
    else:
        break
print(c)

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

Solution (Python):
n,x = map(int,input().split())
a= list(map(int, input().split()))
b = [ sum(a[:i]) for i in range(n+1)]
c = 0
for i in range(len(b)):
  if b[i]<=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+1):
    if (i>n-1)and(d<=x):
        i+=1
        break
    if d>x:
        break
    d=d+l[i]

print(i)

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

count = 1
d = 0

for li in l:
    d += li
    if d > x:
        break
    else:
        count += 1
        
print(count)

Solution (Python):
N, X = map(int, input().split())
L = list(map(int, input().split()))
a = 0
li = [0]
for i in range(len(L)):
    a += L[i]
    li.append(a)

ans = 0
for x in li:
    if x <= X:
        ans += 1

print(ans)

Solution (Python):

n,x=map(int,input().split())
L=input().split()
L=[int(i) for i in L]
count=0
l=0
while l<=x:
    if count>n-1:
        count=count+1
        break
    else:
        l=l+L[count]
        count=count+1
print(count)

Solution (Python):
n,x=map(int,input().split())
a=list(input().split())
count=0
d=0
i=0

while d<=x:
    if i==0:
        d=0
        count=1
        i+=1
    elif count<=n+1 and i<n+1:
        d=d+int(a[i-1])
        if d<=x:
            count+=1
            i+=1
        else:
            break;
    else:  
        break;
print(count)

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

bound=0
point=1

for n in range(N):
    bound=bound+L[n]
    if bound<=X:
        point+=1

print(point)

Solution (Python):

import numpy as np

N, X = map(int, input().split())
L = list(map(int, input().split()))
L = [0] + L

print(sum(np.cumsum(L) <= X))

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

for i, num in enumerate(list_):
  l += num
  if l > x:
    print(i+1)
    break
else:
  print(n+1)

Solution (Python):
n, x = (int(i) for i in input().split())
l_array = [int(i) for i in input().split()]

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    counter+=1
    if counter == n+1:
        break
    else:
        coordinate += l_array[counter-1]


print(counter)

Solution (Python):
N,X = map(int,input().split())
Ls = list(map(int,input().split()))
	
count = 1
s = 0
for l in Ls:
	
	s += l
	
	if X < s:
		break
		
	count += 1
		
print(count)

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

Solution (Python):
from itertools import accumulate

n, x = list(map(int, input().split()))
lll = list(map(int, input().split()))
lcc = list(accumulate(lll))
print(sum(d <= x for d in lcc) + 1)

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

d = 0
i = 0
if x > 0:
    while d <= x:
        d = d + l[i]
        i = i + 1
        if i >= n:
            break
    if d > x:
        print(i)
    elif d <= x:
        print(n+1)
elif x <= 0:
    print(1)

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

 
print(i)