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

Solution (Python):

n,x = map(int,input().split())
b = list(map(int,input().split()))
cnt = 0
ans = 1
for i in b:
    cnt += i
    if cnt <= x:
        ans += 1

print(ans)

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

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):
N, X = map(int, input().split())
L = [int(s) for s in input().split()]

count = 1
D = 0
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 = list(map(int, input().split()))
cnt = 1
di = 0

for li in L:
    di += li
    if di > X:
        break
    cnt += 1

print(cnt)

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

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

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

Solution (Python):
import numpy as np


def main():
    n, x = map(int, input().split())
    ls = np.array(list(map(int, input().split())))
    ans = 1
    h = 0
    for l in ls:
        h += l
        if h <= 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()))
count = 1
s = 0
for i in range(N):
    s += L[i]
    if s <= X:
        count += 1
print(count)

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

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

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

print(ans)

Solution (Python):
def getint():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

num,lim = getint()
l = getint()
sumup = 0
k = True
for i in range(num):
    sumup = sumup + l[i]
    if sumup > lim:
        print(i+1)
        k = False
        break
if k ==True:
    print(num+1)

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

n,x=miis()
l=lmiis()

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

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

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

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

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

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

num = 0
ans = 1

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

print(ans)

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

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

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

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

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

Solution (Python):
n, x = map(int, input().split())
a = [ int(x) for x in input().split() ]
cnt = 1
s = 0
for aa in a:
    s += aa
    if s <= x:
        cnt += 1

print(cnt)

Solution (Python):


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

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

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

Solution (Python):


import sys

DEBUG = False

def solve():
    return


def read_int_list(sep = " "):
    return [int(s) for s in sys.stdin.readline().rstrip().split(sep)]

def read_int():
    return int(sys.stdin.readline())

def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


def main():
    _, x = read_int_list()
    ls = read_int_list()

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


if __name__ == "__main__":
    main()

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

num = 0
ans = 1

for i in range(n):
    num += li[i]
    if num <= x:
        ans += 1
    else:
        break

print(ans)

Solution (Python):

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

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

Solution (Python):



'''a,b= map(int,input().split())'''


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

li0= [int(x) for x in input().split()]
ans=1
count=0
for i in li0:
  count+=i
  if count<=l:
    ans+=1
  else:
    break
print(ans)

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


d = 0
count = 0
if d <= x:
    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 = list(map(int, input().split()))

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

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

print(ans)

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

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

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

print(ans)

Solution (Python):
from sys import stdin

n, x = (int(x) for x in stdin.readline().rstrip().split())
l = [int(i) for i in stdin.readline().rstrip().split()]

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

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

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

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

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

sumL = 0
count = 0

for x in range(len(L) + 1):
    if sumL <= X:
        count += 1
    if x != len(L):
        sumL += L[x]
print(count)

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

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

za = 0


for count in range(N):
  za += L[count]
  if za > X:
    break

else:
  count += 1
  
print(count+1)

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

L = list(map(int, input().split()))
current = 0
ans = 1  
for l in L:
    current += l
    if current <= X:
        ans += 1
print(ans)

Solution (Python):

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

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

print(sum([d[i]<=x for i in range(n+1)]))

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

pos = 0
cnt = 1

for i in range(N):
    pos += l[i]

    if pos <= X:
        cnt += 1
    else:
        break

print(cnt)

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

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


cnt=1
d=0

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

print(cnt)

Solution (Python):
import bisect
n, x = map(int, input().split())
*l, = map(int, input().split())

cusum = [0]*(n+1)
for i in range(n):
    cusum[i+1] += cusum[i]+l[i]

print(bisect.bisect_right(cusum, x))

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

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

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

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

ans = 1
d = 0
for l in L:
  if d + l <= X:
    d += l
    ans += 1
  else:
    break

print(ans)

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

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

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

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

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

print(cnt+1)

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

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

s = 1
d = 0
for i in l:
  d += i
  if d <= x:
    s += 1
print(s)

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

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

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

    d = [0] * (N + 1)

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

    print(N+1)


main()

Solution (Python):



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

cnt=1
val=0
while True:
    for i in range(N):
        val+=L[i]
        if val<=X:
            cnt+=1
        else:
            break
    break    
print(cnt)

Solution (Python):

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

Solution (Python):
class Solution:
    def solve(self, N: int, X: int, L) -> str:

        count = 1
        distance = 0

        for l in L:
            distance += l
            if distance > X:
                break

            count += 1

        return count


if __name__ == '__main__':

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

    
    solution = Solution()
    print(solution.solve(N, X, L))

Solution (Python):



def main():
  n, x = map(int, input().strip().split())
  Ls   = list(map(int, input().strip().split()))
  d = 0
  count = 1
  for L in Ls:
    d += L
    if d <= x:
      count += 1
    else:
      break
  print(count)

if __name__=='__main__':
  main()

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

Solution (Python):
from itertools import accumulate
n,x = map(int, input().split())
a = [0] + list(map(int, input().split()))
print(len([i for i in accumulate(a) if i < x+1]))

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

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

D =[]
D.append(0)
x = 0

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

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

print(ans)

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

bounds = [0]
summ = 0

for i in range(N):
    summ += Length[i]
    bounds.append(summ)

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

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

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

A = [0]

for i in range(n):
    A.append(A[-1] + L[i])
t = 0
for i in A:
    if i <= x:
        t += 1
print(t)

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

for i in range(n):
    c += l[i]
    y.append(c)

print(len([j for j in y if j <= x]))

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, X = MAP()
L = LIST()

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

print(bound)

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

Solution (Python):
import itertools

N, X = list(map(int, input().split()))
B = list(map(int, input().split()))
Ba = list(itertools.accumulate(B))
cnt = 1
for i in Ba:
    if i <= X:
        cnt += 1
print(cnt)

Solution (Python):
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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

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


cnt = 0
for i in range(n+1):
    if ll[i] <= 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 range(n):
    d = 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()))
cumulative,count=0,1
for l in L:
    cumulative+=l
    if cumulative<=X:count+=1
print(count)

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

Solution (Python):

import sys
input = sys.stdin.readline
N, X = map(int, input().split())
L = [int(x) for x in input().split()]

ans = 1
point = 0

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

print(ans)

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


ans = 0
cumul = [0]
for i, l in enumerate(L):
  d = cumul[-1] + l
  if d > X:
    
    ans = i + 1
    break
  cumul.append(d)
else:
  ans = N + 1


print(ans)

Solution (Python):

import sys


def solve(N: int, X: int, L: "List[int]"):
    d = 0
    for i, l in enumerate(L, 1):
        d += l      
        if d > X:
            print(i)
            return  
    else:
        print(i+1)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    X = int(next(tokens))  
    L = [int(next(tokens)) for _ in range(N)]  
    solve(N, X, L)

if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

print(count)

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

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

count = 0

memo = 0

for i in range(x+1):
    
    if i == 0:
        count += 1
    else:
        memo += t[i-1]
        if memo <= y:
            count += 1
print(count)

Solution (Python):

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

Solution (Python):
import sys

def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getlist():
    return list(map(int, input().split()))
import math
import heapq
import fractions
from collections import defaultdict, Counter, deque
MOD = 10**9 + 7
INF = 10**15

def getyaku(n):
    res = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            res.append(i)
            res.append(n // i)

    return(sorted(list(set(res))))

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

def main():
    n,m = getlist()
    nums = getlist()
    ans = 1
    tmp = 0
    for num in nums:
        tmp += num
        if tmp <= m:
            ans += 1
        else:
            print(ans)
            return
    print(ans)
    return

if __name__ == '__main__':
    main()

"""
9999
3

2916
"""

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

Solution (Python):
import sys
input = sys.stdin.readline
N, X = map(int, input().split())
a = list(map(int, input().split()))
cs = [0] * (N + 1)
for i in range(N): cs[i + 1] = cs[i] + a[i]
res = N + 1
for i in range(N + 1):
  if cs[i] > X:
    res = i
    break
print(res)

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

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

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

print(ans)

Solution (Python):
n,x=map(int,input().split())
a=list(map(int,input().split()))
cnt=1
now=0
if sum(a)<=x:
    print(n+1)
    exit()
for i in a:
    now+=i
    if now>x:
        print(cnt)
        exit()
    cnt+=1

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

for L in L_list:
    if d_sum+L>X:
        break
    d_sum = d_sum + L
    bounce_count = bounce_count + 1

print(bounce_count+1)

Solution (Python):
import sys
stdin = sys.stdin

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

n, x = na()
l = na()
d = 0
cnt = 1
for li in l:
    d += li
    if d <= x:
        cnt += 1
print(cnt)

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,X=MI()
    L=LI()
    C=accumulate(L)
    ans = 1
    for c in C:
        if c <= X:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

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

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

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

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 D <= X:
        ans += 1
print(ans)

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

cnt = 1
D = 0
for l in L:
    D += l
    if D > X:
        print(cnt)
        exit()
    cnt += 1

print(cnt)

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    N, X = map(int, input().split())
    L = [int(l) for l in input().split()]
    count = 1
    now = 0
    for i, l in enumerate(L):
        now += l
        if now <= X: count += 1
    print(count)


    return 0

if __name__ == "__main__":
    solve()

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

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

print(c)

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

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 = accumulate([0] + L)
    ans = 0
    for s in S:
        if s <= X:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
k, n = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
ct = 0
ans = 1
i = 0
while ct <= n and i < len(l):
  ct += l[i]
  ans += (ct <= n)
  i += 1
print(ans)

Solution (Python):
N, X = [int(s) for s in input().split(' ')]
Ls = [int(s) for s in input().split(' ')]
suma = [0]
for L in Ls:
    d = suma[-1] + L
    if d > X:
        break
    suma.append(d)
    
print(len(suma))

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

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

Solution (Python):
import os, sys, re, math

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

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

print(count)

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

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

print(ans)

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

print(c)

Solution (Python):
N,X=map(int,input().split())
l=list(map(int,input().split()))
d=0
cnt=1
while True:
    
    d+=l[cnt-1]
    if d>X:
        print(cnt)
        break
    cnt+=1
    if cnt==N+1:
        print(N+1)
        break
else:
    
    print(cnt)

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 = accumulate([0] + L)
    print(len([e for e in S if e <= X]))


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import sys
read=sys.stdin.buffer.readline

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

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

Solution (Python):



n, x = [int(x) for x in input().split()]
li = [int(x) for x in input().split()]
li2 = [0] + [sum(li[:i + 1]) for i, n in enumerate(li)]
li2 = [n for n in li2 if n <= x]
print(len(li2))

Solution (Python):



n, x = [int(x) for x in input().split()]
li = [int(x) for x in input().split()]
li2 = [0] + [sum(li[:i + 1]) for i, n in enumerate(li)]
li2 = [n for n in li2 if n <= x]
print(len(li2))

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

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

v = 0
ans = 1

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

print(ans)

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

Solution (Python):
import sys

n, b, *l = map(int, sys.stdin.read().split())

def main():
    d = 0
    for i in range(n):
        d += l[i]
        if d > b:
            return i + 1
    return n + 1

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

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

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

ans=1

cursum=0

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

Solution (Python):
N, X = (int(nx) for nx in input().split())

count = 1
prev_d = 0
for ipt in input().split():
    curr_d = prev_d + int(ipt)
    if curr_d <= X:
        count += 1
        prev_d = curr_d
    else:
        break

print(count)

Solution (Python):




def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    count, D = 1, 0
    for l in L:
        D += l
        if D <= X:
            count += 1

    print(count)


if __name__ == "__main__":
    main()

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

from itertools import accumulate
accum = list(accumulate(l))

ans = 1
for a in accum:
    if a <= x:
        ans += 1
    else:
        break
print(ans)

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

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



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

Solution (Python):


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

count = 1
d = 0
for k in l:
    if d + k <= x:
        count += 1
        d += k
    else:
        break


print(count)

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

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

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

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

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

print(ans)

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