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 = list(map(int,input().split()))
a = [0]
for i in range(n):
    tmp = a[i] + l[i]
    a.append(tmp)
ans = 0
for i in range(n + 1):
    if (a[i] <= x):
        ans = ans + 1

print(ans)

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

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

print(len(D))

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

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

Solution (Python):
n,x=map(int,input().split())
Y = list(map(int,input().split()))
Z = [0]*n
a = 0
for i in range(n):
  a +=Y[i]
  Z[i]=a
import bisect
print(1+bisect.bisect_left(Z,x+1))

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

s = 0
cnt = 1

for l in LS:
  s += l
  if s <= X:
    cnt += 1
  else:
    break

print(cnt)

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

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

print(ans)

Solution (Python):
N,X = map(int,input().split())
L = list(map(int,input().split()))
List = [0]*(N+1)
for i in range(1,N+1):
    List[i] = List[i-1] + L[i-1]
import bisect  


print(bisect.bisect_left(List,X+1))

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

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

Solution (Python):

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

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

d=0
ans=0
for i in a:
    d+=i
    if d<=x:ans+=1
print(ans+1)

Solution (Python):


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

d = 0
count = 1

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

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

num = 1
s = 0
for i in range(N):
  s += L[i]
  if s > X: break
  num += 1

print(num)

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

Solution (Python):


import bisect

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

accumu_L=[0]

for i in range (N):
    accumu_L.append(accumu_L[-1]+L[i])



print(bisect.bisect_right(accumu_L,X))

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

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

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

Solution (Python):
n, x = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
count = 1
for i in range(n):
  ans += l[i]
  if ans <= x:
    count += 1
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):
    if d <= x:
        ans += 1
    d += l[i]

if d <= x:
    ans += 1

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N,X=mi()
    L=list(mi())

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

    print(ans)



if __name__ == "__main__":
    main()

Solution (Python):
import itertools
import bisect

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

a = list(itertools.accumulate(l, initial=0))
print(bisect.bisect_right(a, x))

Solution (Python):
n, x = (int(i) for i in input().split())
list_l = [int(j) for j in input().split()]
tmp = 0
count = 0
for i in range(0, n + 1):
    if i == 0:
        pass
    else:
        tmp += list_l[i - 1]
        if tmp > x:
            break
    count += 1
print(count)

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

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

Solution (Python):
import bisect

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

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

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

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

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n, x = M()
l = LI()
wa = 0
ans = 1
for i in l:
    wa += i
    if wa <= x:
        ans += 1
    else:
        break
print(ans)

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

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

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

Solution (Python):
A,B=map(int,input().split(' '))
l=list(map(int,input().split(' ')))
ans=0
count=1
for i in l:
    ans+=i
    if ans<=B:
        count+=1
print(count)

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

Solution (Python):
n, x = list(map(int, input().split()))
arr = list(map(int, input().split()))
if x == 0:
    print(0)
    exit()
sum = 0
count = 1
i = 0
while i < n:
    sum += arr[i]
    i += 1
    if sum <= x:
        count += 1
    else:
        print(count)
        exit()
print(count)

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

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

x = 0
ii = 1
for i in ls1:
    x = x + i
    if x > X:
        break
    ii += 1
print(ii)

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

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

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

Solution (Python):

n,x = map(int, input().split())
a = list(map(int, input().split()))
cnt = 1
total = 0

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

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

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

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

print(count)

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

ans = 1
t = 0
for i in l:
  t += i
  if t <= x: ans += 1
  if t >= x: break
print(ans)

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

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

cnt = 1
z = 0

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

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

print(ans)

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

Solution (Python):
import itertools
import bisect

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

dl = [0] + list(itertools.accumulate(ll))

print(bisect.bisect_right(dl, x))

Solution (Python):
r=input().split()
N=int(r[0])
X=int(r[1])
d=[int(s) for s in input().split()]
ans=1
le=0
for i in range(N):
    le+=d[i]
    if le>X:
        print(ans)
        break
    elif i==N-1:
        print(N+1)
    else:
        ans+=1

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

ans = 1
D = 0
for i in li:
    D += i
    if D <= x:ans += 1
print(ans)

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

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

Solution (Python):

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

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

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

Solution (Python):
n, x = map(int, input().split())
Ls = list(map(int, input().split()))
ans = 1
target = 0
for l in Ls:
  target += l
  if target <= x:
    ans += 1
  else:
    print(ans)
    exit()
print(ans)

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

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

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

Solution (Python):
from collections import defaultdict


def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, x = Input()
    l = Input()
    d = defaultdict(int)
    d[0] = 0
    ans = 0

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

    for i in d.values():
        if i <= x: ans += 1

    print(ans)

main()

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

current = 0
cnt = 1
for l in L:
    current += l
    if current > X:
        break
    cnt += 1

print(cnt)

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

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

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

for l in L:
    val += l
    if val <= x:
        count += 1
print(count)

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

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

    for cnt in range(2, N + 2):
        D += L[cnt - 2]
        if D > X:
            cnt -= 1
            break

    print(cnt)


if __name__ == "__main__":
    main()

Solution (Python):
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  

N,X = MI()
L = LI()

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

print(ans)

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

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

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

D = []
D.append(0)

for i in range(0,N):
  D.append(D[i]+L[i])

cnt = 0
for d in D:
  if d <= X:
    cnt += 1
    
print(cnt)

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

sumList = [0]
for i in range(n):
    s = sumList[i]+l[i]
    if s > X:
        break
    sumList.append(s)

print(len(sumList))

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

Solution (Python):
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(i + 1)
        exit()
print(n + 1)

Solution (Python):
from itertools import accumulate
from bisect import *
N, X = map(int, input().split())
L = list(tuple(map(int, input().split())))

acc = sorted(list(accumulate(L)) + [0])

n = bisect_right(acc,X)
print(n)

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

D = 0
cnt = 1
for l in L:
    D = D + l
    if D > X:
        break
    cnt +=1

print(cnt)

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

Solution (Python):
import bisect
from itertools import accumulate
N, X = map(int, input().split())
L = list(map(int, input().split()))
Lsum = list(accumulate(L))
ind = bisect.bisect_right(Lsum, X)
print(ind+1)

Solution (Python):
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


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

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

a = 0
count = 1
for i in l:
    a += i
    if a <= x:
        count += 1
print(count)

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

print(N+1)

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

ans=1
d=0

for i in a:
  d+=i
  if d>x:
    break
  ans+=1
  
print(ans)

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

jump_point = [0]
tmp = 0
for point in list:
    tmp += point
    jump_point.append(tmp)

ans = 0
for i in jump_point:
    if i <= x:
        ans += 1

print(ans)

Solution (Python):
n, x = map(int, input().split())
l = list(map(int, input().split()))
xlist = [0]
num = 0
for i in l:
    num += i
    xlist.append(num)
cnt = 0
for j in xlist:
    if j <= x:
        cnt += 1
print(cnt)

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

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

Solution (Python):

n, x = map(int, input().split())
lis = list(map(int, input().split()))
ans = 0

bou = [0]
for i in range(n):
    bou.append(bou[i] + lis[i])

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

print(ans)

Solution (Python):
import itertools
import bisect

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

A = list(itertools.accumulate(L))
print(bisect.bisect(A, X) + 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+=l[i]
    if d<=x:
        ans+=1
    else:
        break
print(ans)

Solution (Python):
from itertools import accumulate

n, x = map(int, input().split())
L = list(map(int, input().split()))
C = [0] + list(accumulate(L))


cnt = 0
for c in C:
    if c <= x:
        cnt += 1
print(cnt)

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

print(ans)

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

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

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

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

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

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

print(ans)

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

D = 0
ans = 1

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

print(ans)

Solution (Python):
n,x=list(map(int,input().split()))
l=list(map(int,input().split()))
from itertools import accumulate
l=[0]+list(accumulate(l))


from bisect import bisect_right
print(bisect_right(l,x))

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=d+l[i-1]
    if d<=x:
        cnt+=1

print(cnt)

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

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

count = 1

d = 0

for x  in l:
    d = d + x

    if d <= X:
        count += 1

print(count)

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

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

cnt = 1
d = 0

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

print(cnt)

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

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

dis = 0
cnt = 1

for L in map(int, input().split()):
    dis += L
    cnt += dis <= X

print(cnt)

Solution (Python):
n, x = list(map(int, input().split()))
l = list(map(int, input().split()))
cur_d = 0
res = 1
for li in l:
    cur_d += li
    if cur_d > x:
        break
    res += 1
print(res)

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

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

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

c=1
suml=0
for i in range(n):
    if x>=L[i]+suml :
        c+=1
        suml+=L[i]
    else:
        break
print(c)

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

ans = 0

for dd in d:
    if dd <= x:
        ans += 1
print(ans)

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

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

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,x = readInts()
L = readInts() + [0]
cnt = 0
now = 0
for i in range(n+1):
    if now <= x:
        cnt += 1
        now += L[i]
    else:
        break
print(cnt)

Solution (Python):
from itertools import accumulate

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

a = accumulate(L)

for key, i in enumerate(a):
    if i > X:
        print(key+1)
        exit()

print(N+1)

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

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

Solution (Python):
N, X = map(int, input().split())
*L, = map(int, input().split())
ans = 1
d = 0
for l in L:
    if d + l <= X:
        ans += 1
        d += l
    else:
        break
print(ans)

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

Solution (Python):
n,x = map(int, input().split())
ll = list(map(int, input().split()))
cnt = 1
v = 0
for l in ll:
    v += l
    if v > x:
        break
    else:
        cnt += 1

print(cnt)

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

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):
def main():
    N, X = (int(i) for i in input().split())
    L = [int(i) for i in input().split()]
    from itertools import accumulate
    S = list(accumulate([0] + L))
    ans = 0
    for s in S:
        if X < s:
            break
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    N, X = inl()
    L = inl()
    cnt = 1
    d = 0
    for i in range(N):
        d += L[i]
        if d > X:
            break
        cnt += 1

    return cnt


print(solve())

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

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

print(sum(1 for li in lis if li <= x ))

Solution (Python):
n,x = list(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 = 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 = list(map(int, input().split()))
L = list(map(int, input().split()))
ans = 1
d = 0
for i in range(N):
	tmp = d + L[i]
	if tmp <= X:
		ans += 1
	d = tmp
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 += l[i]
    if d <= x:
        ans += 1
print(ans)

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

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

for i in range(1,n+1):
    temp=d[i-1]+l[i-1]
    if temp>x:
        ans=i
        break
    d.append(temp)

else:
    ans=n+1

print(ans)

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

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

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

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

c = 1
y = 0

for m in l:
    if y + m <= x:
        c += 1
        y += m
    else:
        break

print(c)

Solution (Python):
def main():
    n, x = map(int, input().split())
    l_lst = list(map(int, input().split()))
    count = 0
    coordinate_lst = [0]

    for i in range(n):
        coordinate_lst.append(coordinate_lst[i] + l_lst[i])

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

    print(count)


if __name__ == '__main__':
    main()

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


from functools import reduce

def solve(X, Ls):
  return len(list(filter(
    lambda x: x <= X, reduce(lambda x, y: x + [x[-1] + y], Ls, [0]))))


if __name__ == '__main__':
  _, X = map(int, input().split())
  print(solve(X, map(int, input().split())))

Solution (Python):


def solve(X, Ls):
  c, s = 0, 0
  for L in Ls:
    s += L
    if s > X:
      break
    c += 1
  return c + 1


if __name__ == '__main__':
  _, X = map(int, input().split())
  print(solve(X, map(int, input().split())))

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

Solution (Python):
from itertools import accumulate
from bisect import *
N, X = map(int, input().split())
L = list(map(int, input().split()))
S = list(accumulate([0]+L))
print(bisect_right(S,X))

Solution (Python):
n, x = list(map(int, input().split()))
l = list(map(int, input().split()))
d = [0]
for i in range(len(l)):
    d.append(d[i] + l[i])
print(len(list(filter(lambda d_i: d_i <= x, d))))

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):
N, X = map(int, input().split(' '))
L_ls = map(int, input().split(' '))
D, cnt = 0, 1
for L in L_ls:
    D += L
    if D > X:
        break
    cnt += 1
print(cnt)

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

N, X = LI()
L = LI()


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


if __name__ == "__main__":
    main()

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

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

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

i = 0
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

if s <= X:
  i += 1

print(i)