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):
def main():
    n, x = map(int, input().split())
    a = [int(i) for i in input().split()]
    pref = [0, a[0]]
    for i in range(1, n): pref.append(a[i] + pref[i])
    ans = 0
    for val in pref:
        if val > x:
            break
        ans += 1
    print(ans)


main()

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

cnt = 0
ichi = 0
for l in L_list:
    
    if ichi > X:
        break
    cnt += 1
    ichi += l

if ichi <= X:
    cnt +=1

print(cnt)

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

l = [int(i) for i in 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())
a= list(map(int,input().split()))
s= 0
c=1
for v in a:
    s+=v
    if s<=x:
        c+=1

print(c)

Solution (Python):
from sys import stdin

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = [int(x) for x in stdin.readline().rstrip().split()]
Sum = 0
cnt = 1
for i in range(N):
    if Sum + L[i] <= X:
        cnt += 1
        Sum += L[i]
    else:
        break
print(cnt)

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

    if d <= x:
        count += 1
print(count)

Solution (Python):

def main():
    N,X = map(int,input().split())
    L=[int(i) for i in input().split()]
    Ls = 0
    count = 1
    for i in range(N):
        Ls = Ls+L[i]
        
        if Ls<=X:
            count+=1
    print(count)


if __name__ == '__main__':
    main()

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

sum=0
res=0
for step in range(n):
    if sum<=x:
        res+=1
        sum+=L[step]
    else:
        break
    
if sum<=x:
    res+=1

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]

ans = sum([1 if dv <= X else 0 for dv in d])

print(ans)

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

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

print(count)

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

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

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



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


ans = 1
sum_x = 0
for i in range(N):
    if(sum_x + List[i] <= X):
        
        sum_x += List[i]
        ans += 1
    else:
        break

print(ans)

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

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


N, X = inpl()
L = [0] + inpl()

ans = 0
x = 0
for i in range(len(L)):
    x += L[i]
    if x > X:
        break
    ans += 1

print(ans)

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

N = int(N)
X = int(X)

l_list = input().split()

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

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

ans = 0
point = 0

for i in range(len(l_li)+1):
    if i == 0:
        ans += 1
    else:
        point = point + l_li[i-1]
        if point <= x:
            ans += 1
print(ans)

Solution (Python):
n, x = map(int,input().split())
a =  list(map(int,input().split()))
total = 0
for i, it in enumerate(a):
    total += it
    if total > x:
        break

if total <= x:
    i += 1
 
print(i+1)

Solution (Python):
cnt , a = map(int, input().split())
list_ = list(map(int,input().split()))
count = 1
b = 0

for i in list_:
  b += i
  if b > a:
    break
  else:
    count += 1
print(count)

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

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

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

sum = 0
cnt = 1
for i in lst:
  sum += i
  if (sum <= X):
    cnt += 1
  else:
    break
    
print(cnt)

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

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

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

Solution (Python):


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

N = line1[0]
X = line1[1]

D = 0
count = 1

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

print(count)

Solution (Python):
N, X = list(map(int,input().split(" ")))
L = list(map(int,input().split(" ")))
l_sum = 0
flag = False
for i in range(N):
    l_sum += L[i]
    if l_sum>X:
        print(i+1)
        flag = True
        break
if not flag:    
    print(N+1)

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

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

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

if n==1 and sum(l)<=x:
  print(2)
elif sum(l) <= x:
  print(n+1)
else:
  for i in range(n+1):
    ll = l[:i]
    if sum(ll)>x:
      break
  print(len(ll))

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

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

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

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

print(count)

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


N,X=acinput()
L=acinput()

count=0
h=0
for i in range(len(L)):
        count+=1
        h+=L[i]
        if h>X:
                break
        if i==len(L)-1:
                count+=1

if count==0:
        count=1
print(count)

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

cnt = 0
ans = [0]

for i in l:
    cnt += i
    if cnt <= x:
        ans.append(cnt)
print(len(ans))

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

pointList = [0]
for i in range(len(L)):
  x = pointList[i]+L[i]
  pointList.append(x)
    
num = 0
    
for i in range(len(pointList)):
  if pointList[i]<=X:
    num += 1

print(num)

Solution (Python):
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
broken = False
for n in range(N):
    D += L[n]
    if D > X:
        broken = True
        break

if broken:
    print(n+1)
else:
    print(n+2)

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

cnt = 0
D_i = 0
for L in L_list:
    D_i = D_i + L
    if D_i <= X:
        cnt += 1

print(cnt + 1)

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

ans = 1
d = 0
while True:
    if ans >= n + 1:
        break
    d += L[ans - 1]
    if d > x:
        break

    ans += 1

print(ans)

Solution (Python):
x = int(input().split()[1])

ls = [int(n) for n in input().split()]

for index in range(len(ls)):
	list = ls[0:index]
	if sum(list) > x:
		print(index)
		break
	elif sum(list) == x:
		print(index + 1)
		break

	if index == len(ls) - 1:
		print(len(ls) + 1)

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

ans = [0]
for i, v in enumerate(L):
    v_next = ans[i] + v
    ans.append(v_next)

print(sum(i <= X for i in ans))

Solution (Python):


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

l = input().split()
num = 0
for i,k in enumerate(l):
  num += int(k)
  if num<=x:
    out = i+2

print(out)

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

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

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

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

print (ans)

Solution (Python):
import numpy as np

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

res = sum([1 if e <= X else 0 for e in np.cumsum(L)])

print(res)

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

n, x = LI()
l = LI()

s = [sum(l[0:i]) for i in range(n+1)]
count = sum([x >= i for i in s])

print(count)

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

D = 0
count = 1

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

print(count)

Solution (Python):
n,x = (int(i) for i in input().split())  
l = [int(i) for i in input().split()] 
d = 0
i=0
while d <= x:
    try:
        d+=l[i]
    except:
        i+=1
        break
    i+=1

print(i)

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

print(kai+2)

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

d = 0
cnt = 0
for i in range(0, n + 1):
  if i == 0:
    d = 0
  else:
    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()))
D=0
count=1

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

print(count)

Solution (Python):

N,X = map(int,input().split())
L_list = [0 for i in range(N)]

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

D = 0
count = 0

if D <= X :
    count += 1

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

print(count)

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

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

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

if D <= X:
    print(cnt + 1)
else:
    print(cnt)

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

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

Solution (Python):
numN, numX = [int(i) for i in input().split()]
numList = [int(i) for i in input().split()]

D = 0
counter = 1
for Li in numList:
    D = D + Li
    if D > numX:
        break
    else:
        counter+=1
print(counter)

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

Solution (Python):
def main():

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

    jump=[0]
    sum=0
    for i in range(n):
        sum+=point[i]
        jump.append(sum)

    count=0
    for k in range(n+1):
        if jump[k]<=x:
            count+=1
    print(count)

    
if __name__=="__main__":
    main()

Solution (Python):
n, x = list(map(int, input().split()))
llist = list(map(int, input().split()))
kai = 0
tsumu = 0
while tsumu <= x and llist != [] :
    kai += 1
    tsumu += llist.pop(0)
else :
    if tsumu <= x :
        kai += 1
print(kai)

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

Solution (Python):
def B(n, x, a):
    i = 0
    sum_n = 0
    while i < n:
        sum_n += a[i]
        if sum_n > x:
            break
        i += 1

    return i+1


if __name__ == "__main__":
    n, x = map(int, input().split())
    a = list(map(int, input().split()))

    print(B(n, x, a))

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

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

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

Solution (Python):



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

    ans = 0
    d = 0
    i = 0
    
    
    
    
    

    while d <= X and i <= N:
        if i < N:
            d += L[i]
        ans += 1
        i += 1
        

    print(ans)
    return


if __name__ == "__main__":
    main()

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

count= 0
sumList=[]
sumList.append(0)

for i in range(N):
  if(sum(L[0:i+1]) > X):break
  sumList.append(sum(L[0:i+1]))

print(len(sumList))

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

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

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

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

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

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

cnt = 1
now = 0
for i in l:
    now += i
    if now>x:
        break
    cnt += 1

print(cnt)

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

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

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

Solution (Python):



def main():
    from bisect import bisect

    n, x = map(int, input().split())
    ls = list(map(int, input().split()))
    dist = [0]

    for i in range(1, n + 1):
        dist.append(dist[i - 1] + ls[i - 1])

    print(bisect(dist, x))


if __name__ == '__main__':
    main()

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

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
    if i==n-1:
        print(n+1)
        break

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

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

    def count_bound(self):
        d = 0
        counter = 1

        
        for l in self.L:
            d += l
            if d <= self.X:
                counter += 1
            else:
                break

        print(counter)


bounding = Bounding()
bounding.count_bound()

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

ans = 1
CurrentNum = 0

for i in L:
  CurrentNum += i
  
  if CurrentNum <= X:
    ans += 1
  else :
    break

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())

n,x=intinput()
l=list(intinput())
d=[0]
for i in range(n):
    d.append(d[i]+l[i])
print([d[i]<=x for i in range(n+1)].count(True))

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

D = 0
cnt = 0
for i in L:
    D += i
    cnt += 1
    if D > X:
        break
if D <= X:
    cnt += 1
print(cnt)

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

sum = 1
now = 0

for i in range(len(l)):
    now += l[i]
    if now <= x:
        sum += 1
    else:
        break
print(sum)

Solution (Python):
import sys,collections,math,random;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

X,A = Is()
lis = [0] + Is()
t = 0
for i in range(X+1):
    t += lis[i]
    if t > A:
        print(i)
        exit()
    elif i == X:
        print(X+1)
        exit()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
 
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))
 
N, X = mi()
L = li()
 
count = 1
D = 0
for i in range(N):
  D += L[i]
  if X >= D:
    count += 1
  else:
    break
 
print(count)

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)
        break
    if i == N-1:
        print(i+2)

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 (X < S):
    break
  count += 1
print(count)

Solution (Python):
from sys import stdin

n, x = [int(x) for x in stdin.readline().rstrip().split()]
an = list(map(int, input().split()))

pos = 0

ans = 0
while ans < n:
    ans += 1
    pos += an[ans-1]
    if x < pos:
        break

if pos <= x:
    ans += 1

print(ans)

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

print(ans+1)

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

Solution (Python):
import numpy as np
n,x = map(int, input().split())
l = list(map(int, input().split()))
pop = [0] * (n)
pre = 0
for idx,i in enumerate(l):
  pop[idx] = pre + i
  pre = pop[idx]

print(np.sum(np.array([0]+pop) <= x))

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

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

d = 0
count = 1
for i in l:
    d += i
    if X < d:
        break
    count+=1

print(count)

Solution (Python):

N, X = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]
D = 0
count = 0
answer = 1

while D <= X:
  if count + 1 > len(L):
    print(N+1)
    exit()
  D += L[count]
  count += 1
  answer += 1

print(answer - 1)

Solution (Python):
import sys

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

count = 1
D = 0
for k in L_list:
    D = D + k
    count = count + 1
    if D > X:
        print(count - 1)
        sys.exit()

print(N + 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:
        break
    else:
        count += 1
print(count)

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

Solution (Python):

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

dp = 0
i = 0
count = 0

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

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

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

Solution (Python):
n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 1
bound = 0
for i,y in enumerate(l):
    bound += y
    if bound <= x and i <= n:
        ans += 1
    else:
        break
print(ans)

Solution (Python):
from copy import deepcopy
import sys
from itertools import accumulate
N,X = map(int,input().split())
Llist = list(map(int,input().split()))

ruiseki = accumulate(Llist)
for i,r in enumerate(ruiseki,2):
    if r <= X:
        continue
    else:
        print(i-1)
        sys.exit()
print(i)

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

res = 1
x = 0
for l in L_list:
    x += l
    if x <= X:
        res += 1
print(res)

Solution (Python):
n,x=map(int,input().split())
l=list(map(int,input().split()))
c,k=1,0
for i in l:
  k+=i
  if k>x:
    break
  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:
    break
  else:
    ans += 1
print(ans)

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

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

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

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

mylist = input().split()
mylist = ['0'] + mylist

mycnt = 0
mysum = 0
for i in mylist: 
  mysum += int(i)
  if mysum <= X:
    mycnt +=1
  else:
    break
print(mycnt)

Solution (Python):
N,X=[int(i) for i in input().split()]
L=[int(i) for i in input().split()]
sL=0;j=0
for i in range(len(L)):
  sL+=L[i]
  if sL>X:break
  j+=1
print(j+1)

Solution (Python):
N,X = map(int,input().split())
L = [int(_) for _ in input().split()]
INF = 10**12
D = [INF]*(N+1)
D[0] = 0
for i in range(1,N+1):
    D[i] = D[i-1] + L[i-1]
n = [1 for _ in D if _ <= X]
print(sum(n))

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

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

bounce_list = [0] * (N + 1)
for i in range(1, N + 1):
    bounce_list[i] = bounce_list[i - 1] + l_list[i - 1]

print(len([i for i in bounce_list if i <= X]))

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

d=0
cnt=0
for i in range(N+1):
    if d>X:
        break
    elif i==N:
        cnt+=1
    else:
        d+=L[i]
        cnt+=1
   
print(cnt)

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

print(N+1)

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

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

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

Solution (Python):

def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

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

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

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

for i in range(N):
  d = d + L[i]
  if d > X:
    break
  j = j + 1

print(j)

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

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

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

result = 1
for i in range(inputa[0]):
  inputa[1] -= inputb[i]
  if inputa[1] < 0:
    break
  else:
    result += 1

print(result)

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

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

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

if __name__ == "__main__":
    solve()

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

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

flag = True
for i in range(n+1):
    if li[i]>x:
        ans = i
        flag = False
        break

if flag:
    print(n+1)
else:
    print(ans)

Solution (Python):


def Solve():
    N,X=(int(x) for x in input().split())
    L=[int(x) for x in input().split()]
    dis=0
    count=1
    for i in range(N):
        dis+=L[i]
        if dis>X:
            return count
        count+=1
    return N+1
print(Solve())

Solution (Python):
N, X = map(int, input().split())
L = list(map(int, input().split()))
ans = 1
Xi = 0
for Li in L:
    Xi += Li
    if Xi <= X:
        ans += 1
print(ans)

Solution (Python):

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

X = NX[1]

bound = 1
point = 0

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

print(bound)

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

count = 1
total_b = 0

for b in bound_list:
    total_b += b
    if total_b <= X:
        count += 1

print(count)

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

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

D, ans = 0, 1
for l in L:
    D += l
    if D <= X:
        ans += 1
print(ans)

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

ans = 1
num = 0
for l in L:
    num += l
    if num <= X:
        ans += 1
    
print(ans)

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

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

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

lx = 0
cnt=1
for pl in l:
  lx += pl
  if lx > x:
    break;
  cnt += 1

print(cnt)

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

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


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

z = 0
cnt = 1
for i in l:
    z += i
    if z <= x:
        cnt += 1
    else:
        print(cnt)
        exit()
print(cnt)

Solution (Python):
if __name__=='__main__':
    N, X = map(int, input().split())
    L = [int(x) for x in input().split()]
    count = 1
    length = 0
    for i in range(N):
        length += L[i]
        if length>X: break
        count += 1
    print(count)

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

Solution (Python):
N,X=map(int,input().split())
ps = [int(i) for i in input().split()]
resum=0
count=1
for i in ps:
    resum += i
    if resum>X:
        break
    count+=1
print(count)
exit(0)

Solution (Python):
import sys

def main():
    N, X = map(int, input().split())
    A = list(map(int, input().split()))

    cnt = 0
    D = 0
    for a in A:
        D += a
        cnt += 1
        if D > X:
            cnt -= 1
            break

    return cnt+1


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

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

sum_l = 0
if sum(Ls) <= x:
    print(n+1)
else:
    for idx in range(n):
        sum_l += Ls[idx]
        if sum_l > x:
            print(idx+1)
            break

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