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().strip().split())
l = list(map(int, input().strip().split()))

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

print(i+1)

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

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


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

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

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

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

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

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

Solution (Python):
from bisect import bisect_right

n, x = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
for i in range(n):
    D += [L[i] + D[i]]
ans = bisect_right(D, x)
print(ans)

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

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

cnt = 1
d = 0
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()))

jump = [0]
num = 0
for i in range(N):
    num += L[i]
    jump.append(num)

ans = 0
for i in jump:
    if i <= X:
        ans += 1
print(ans)

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

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

ans, D = 1, 0
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()))

temp = []

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

Solution (Python):
NN = input().split()
N = int(NN[0])
X = int(NN[1])
LL = input().split()
list1 = [0]
for i in range(N):
  
  a = list1[i] + int(LL[i])
  list1.append(a)
count = 0
for i in list1:
  if int(i) <= X:
    count +=1
print(count)

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

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

Solution (Python):

N, X = [int(n) for n in input().split()]
l = [int(n) for n in input().split()]

D = [0]
for i in range(N):
    D.append(D[-1] + l[i])



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

print(count)

Solution (Python):
n, x = map(int, input().split())
data = [0] + list(map(int, input().split()))
count = 0
tmp = 0
for d in data:
    tmp += d
    if tmp <= x:
        count += 1
    

print(count)

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

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

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

print(counter)

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

D = 0
for i in range(len(L)) :
  D += L[i]
  if D > X:
    print(i+1)
    exit()

print(len(L)+1)

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]
print(sum([i<=x for i in d]))

Solution (Python):


def main():

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

    D = 0
    ans = 0

    if D <= X:
        ans += 1

    for i in L:
        D += i
        if D <= X:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import sys

N, X = map(int, input().split())
L = list(map(int, sys.stdin.readline().rsplit()))

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

print(res)

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

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

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

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

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

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

Solution (Python):
import bisect

N,X=map(int,input().split())
L=list(map(int,input().split()))
sumL=[0]
for i in range(N):
    sumL.append(sumL[i]+L[i])
print(bisect.bisect_right(sumL,X))

Solution (Python):
import bisect
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
for l in L:
  D.append(l+D[-1])
print(bisect.bisect_right(D, X))

Solution (Python):












































global FLAG_LOG
FLAG_LOG = False


def log(value):
    
    
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    
    
    N, X = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    
    
    
    
    
    
    

    su = 0
    cnt = 1
    for i in range(N):
        su += values[i]
        if su <= X: 
            cnt += 1
        else:
            break

    return [cnt]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 6', '3 4 5']
        lines_export = [2]
    if pattern == 2:
        lines_input = ['4 9', '3 3 3 3']
        lines_export = [4]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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

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

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

d=0

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

if d<x+1:
    count +=1

print(count)

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

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

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

main()

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

ans =1
height=0
for i in range(N):
    height += arr[i]
    if height > X:
        break
    ans += 1

print(ans)

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

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

cnt = 1
position = 0

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

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

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

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

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

coordinate = 0
count = 0

while count < N:
    coordinate += L[count]
    if coordinate > X:
        break
    else:
        count += 1

print(count+1)

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

D = 0
ans = 0
if D <= X:
    ans += 1
for l in L:
    D = l + D
    if D <= X:
        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(n):
  d += l[i]
  if d <= x:
    count += 1
    
    
print(count)

Solution (Python):
N,X=map(int,input().split())
List = list(map(int, input().split()))
height = 0
res = 1
def checkF(k,x):
  if k>x:
    return True
  else:
    return False
    
for i in range(N):
  height += List[i]
  res +=1
  if checkF(height,X):
    res = res-1
    break
print(res)

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

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

D = [0]

ans = 1

for i in range(0,N):
    D.append(D[i]+L[i])
    if D[i+1] > X:
        break
    else:
        ans += 1

print(ans)

Solution (Python):


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

d = 0
ans = 1

for l in ll:
    d += l

    if d > x:
        break


    ans += 1

print(ans)

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

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

for i in l:
    p += i
    count += 1
    if p > X:
        count -= 1
        break
print(count)

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

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

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

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

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

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

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

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

sum = 0
cnt = 1
for i in range(0,len(l)):
    sum += l[i]
    if sum <= x:
        cnt += 1
print(cnt)

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

cnt = 1
a = 0
for i in range(0, len(l)):
  a += l[i]
  if a <= x:
    cnt += 1

print(cnt)

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

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

Solution (Python):
a,b=map(int, input().split())
c=list(map(int, input().split())) 
x = 0
ans = 1

for i in c:
    x += i
    if x <= 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(n):
  d += l[i]
  if d<=x:
    count+=1
print(count)

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

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

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

Solution (Python):
N,X=map(int,input().split())
p=0
cnt=1
for i in map(int,input().split()):
 p+=i
 if (X<p):break
 cnt+=1
print(cnt)

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

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

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

count = 1
point = 0
for I in range(len(array)):
    point += array[I]
    if point <= X:
        count += 1
    else:
        break
print(count)

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

count = 1
point = 0
for I in range(len(array)):
    point = point + array[I]
    if point <= X:
        count += 1
    else:
        break
print(count)

Solution (Python):
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

N, X = rl()
L = rl()

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

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

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

print(cnt)

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

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(d[i] <= x for i in range(n+1))
print(ans)

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

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

print(ans)

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

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

curCoord = 0
n = 1

while (curCoord<=X):
    n = n+1
    
    if (n>N+1):
        break
    else:
        curCoord = curCoord+L[n-2]

print(n-1)

Solution (Python):

def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))
  
n,x=input2()
L=input_array()

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

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

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

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

s = 0
S = []
for i in range(N+1):
    s += L[i]
    S.append(s)

c = 0
for s in S:
    if s <= X:
        c += 1
print(c)

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

reach = 0
for i, v in enumerate(L):
  reach += v
  if reach > x:
    print(i + 1)
    exit()
print(n + 1)

Solution (Python):
import sys
sys.setrecursionlimit(10**7) 
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right

from collections import deque, defaultdict


from collections import Counter

from itertools import accumulate,combinations,permutations,product

from heapq import heapify,heappop,heappush


from functools import reduce,lru_cache

from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    

    
    N, K = map(int, input().split())
    A = tuple(map(int, input().split())) 
    
    

    cur=0
    ans=1
    for a in A:
        cur+=a
        if cur<=K:
            ans+=1
    print(ans)




if __name__ == "__main__":
    main()

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

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

dist = np.zeros(N+1, dtype=int)
for i in range(N):
  dist[i+1] = dist[i] + L[i]

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

Solution (Python):
N, X = map(int, input().split())
l = [0] + list(map(int, input().split()))
d = [0]

for i in range(1, N+1):
    d.append(d[-1]+l[i])

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()))
s = 0
count = 1
for i in l:
    s += i
    if s > x:
        break
    count += 1
print(count)

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

Solution (Python):
import itertools
n,x=map(int,input().split())
l=list(map(int,input().split()))
cumsum=[0]+list(itertools.accumulate(l)) 
cnt=0
for c in cumsum:
    if c<=x:
        cnt+=1
print(cnt)

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

ans = 1

for i in L:
  D += i
  if D <= X:
    ans += 1

print(ans)

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

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

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):
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:
        break
    cnt += 1

print(cnt)

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


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 0
    cumsum = [0] * (n + 1)
    for i in range(len(l)):
        cumsum[i+1] = cumsum[i] + l[i]
    for i in cumsum:
        if i <= x:
            ans += 1
        else:
            break
    print(ans)
    
if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

_, x = rm()
li = rl()
cnt = 0
d = 0
for i in li:
  d += i
  if d <= x:
    cnt += 1
print(cnt + 1)

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])
cnt = 0
for j in d:
    if j <= 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(N):
    d = d + l[i]
    if d <= X:
        count += 1

print(count)

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

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N, X = I()
L = [0] + l()
l = list(itertools.accumulate(L))

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

print(count)

Solution (Python):
n,x = map(int,input().split())
l_lst = list(map(int,input().split()))
b = 0
sum_l = 0
for l in l_lst:
  b+=1
  sum_l += l
  if sum_l > x:
    break
if sum_l <= x:
  b+=1

print(b)

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict, deque



sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)


MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, X = il()
    L = il()
    d, ret = 0, 1
    for l in L:
        d += l
        if d <= X:
            ret += 1
        else:
            break
    print(ret)


if __name__ == '__main__':
    main()

Solution (Python):
import bisect
import sys
input = sys.stdin.readline

N,X = list(map(int,input().split()))
L = list(map(int,input().split()))
bn = [0]
for i in range(N):
    bn.append(bn[-1]+L[i])
print(bisect.bisect_right(bn,X))

Solution (Python):
read = lambda: list(map(int, input().split()))
n, x = read()
l = read()
s = 0
ans = 1
for ind, d in enumerate(l):
    s += d
    if s > x:
        break
    ans += 1
print(ans)

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


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


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):
  if d+l[i] <= x:
    d += l[i]
    ans += 1
  else:
    break
print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, X = mapint()
Ls = list(mapint())

now = 0
cnt = 0
for l in Ls:
    if now>X:
        break
    now += l
    cnt += 1
else:
    if now<=X:
        cnt += 1
print(cnt)

Solution (Python):
import sys
import itertools
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n,x = IL()
    l = [0]+list(IL())
    l = list(itertools.accumulate(l))
    ans = 0
    for rep in l:
        if x<rep:   break
        ans += 1
    print(ans)
    return

if __name__=='__main__':
    Main()

Solution (Python):


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

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

cnt = 1
now = 0
for i in range(N):
    l = now + lst[i]
    if l > X:
        break
    else:
        cnt += 1
        now = l
    

print(cnt)

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

Solution (Python):
import math
import collections
import fractions
import itertools

def solve():
    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:
            break
        ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    solve()

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

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

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

d = 0
cnt = 1

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

print(cnt)

Solution (Python):
N,X = map(int,input().split())
L = list(map(int,input().split()))
l = [0]
for a in L:
    l.append(l[-1] + a)
print(len([1 for c in l if c <= X]))

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)
        exit()
print(n + 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):
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = 0
a = 1

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

print(a)

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

Solution (Python):
N,X = (int(x) for x in input().split())
L = [int(x) for x in input().split()]
Bound = sum(sum(L[:x])<=X for x in range(0,N+1))
print(Bound)

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

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

print(count)