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

output_list = [0] * (N + 1)
D = [0] * (N + 1)
D[0] = 0
output_list[0] = 0
for i in range(1, N + 1):
    D[i] = D[i - 1] + L[i - 1] 
    output_list[i] = D[i]
output = [x for x in output_list if x <= X]

print(len(output))

Solution (Python):
from sys import exit

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

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

ans = 1

x = 0

for l in L:
    x += l
    if x <= X:
        ans += 1
    else:
        print(ans)
        exit()

print(ans)

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:
    break
  else:
    count += 1

print(count)

Solution (Python):
N, X = list(map(int, input().split()))
L_list = list(map(int, input().split()))
c = 0
ans = 1
for i, l in enumerate(L_list):
    tmp = c+l
    if tmp>X:
        break
    c = tmp
    ans+=1
print(ans)

Solution (Python):

"""
Created on Sat Apr 20 20:47:47 2019

@author: Owner
"""

import numpy as np
import sys
import collections
import scipy.misc
import math
from operator import itemgetter
import itertools
import copy
import bisect


def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]
    

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

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

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())


dp = np.zeros((N+1, 4,4,4))
    
all(nstr.count(c) for c in '753')


ABT = zip(A, B, totAB)
result = 0

sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)


(x >> i) & 1


dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

add = 1 
res = 0
sums = [0]*(len(nums)+1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]
for i in range(0, len(nums), 2):
    left = i
    right = min(i+add, len(nums))
    tmp = sums[right] - sums[left]
    res = max(tmp, res)


li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    


org_list = [3, 1, 4, 5, 2]
new_list = sorted(org_list)
print(org_list)
print(new_list)




    for h in range(0,H):
        for w in range(0,W):
            if h == 0 and w == 0:
                pass
            elif h == 0:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h-1][W-w]+1)
            elif w == 0:   
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1)
            else:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1, D[H-h-1][W-w]+1, D[H-h][W-w]+2)
            d_max = max(D[H-h-1][W-w-1], d_max)

"""



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


def main():
    D = [0]*(N+1)
    res = 1
    for n in range(1,N+1):
        D[n] = D[n-1] + L[n-1]
        if D[n] <= X:
            res += 1
        
    print(res)
                
                
                
            
            
                

    
if __name__ == '__main__':
    main()

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

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

Solution (Python):

if __name__ == '__main__':
    n,x = list(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 = 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()))

coutner = 1
d = 0

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

    if d > x:
        break
    else:
        coutner += 1


print(coutner)

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

k = []
kk = 0
k.append(kk)

for i in l:
    kk += i
    k.append(kk)

answer = 0
for j in k:
    if j <= x :
        answer += 1
    
print(answer)

Solution (Python):
import sys

input = sys.stdin.readline

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

count=1

current=0

for _ in range(n):
    current+=l[_]
    count+=1
    if current > x:
        break



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

Solution (Python):

def main():
    num, x = map(int, input().split())
    data = list(map(int, input().split()))
    now = 0
    ans = 1
    for i in range(num):
        now += data[i]
        if now > x:
            break
        ans += 1

    print(ans)





if __name__ == '__main__':
    main()

Solution (Python):


n=input().rstrip().split(" ")
n[1]=int(n[1])
n[0]=int(n[0])
i=0
l=""
seter=n[1]
d=0
ans=1
l=input().rstrip().split(" ")
for i in range(len(l)):
    l[i]=int(l[i])
    d=d+l[i]
    if(seter >=d):
        ans=ans+1
print(ans)

Solution (Python):

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

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

L = [0]
D = 0

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


count = 1

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

print(count)

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


print(cnt)

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

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

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

for i in range(0, len(L)):
    res = B[i] + L[i]
    if res <= X:
        B.append(res)
    else:
        break
print(len(B))

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

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

d = 0
for i, l in enumerate(L):
  d += l
  if d > X:
    print(i+1)
    exit()
print(i+2)

Solution (Python):

a, b = map(int, input().split())
c = list(map(int, input().split()))
counter = 1
p = 0
for i in range(a):
    p += c[i]
    if p <= b:
        counter += 1
    elif p > b:
        break
print(counter)

Solution (Python):

"""



"""
import sys


def solve(N, X, L):
    ans = 0
    pos = 0
    while pos <= X and L:
        pos += L.pop(0)
        ans += 1
    return ans+1 if pos <= X else ans


def main(args):
    N, X = map(int, input().split())
    L = [int(l) for l in input().split()]
    ans = solve(N, X, L)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

for i in range(N):
    A.append(A[i]+L[i])

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

print(ans)

Solution (Python):
import numpy as np
N, X = map(int, input().split())
l_list = np.array(input().split()).astype(int)


cumsum = np.cumsum(l_list)
print((cumsum <= X).sum()+1)

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

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

print(N + 1)

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

if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = [int(i) for i in input().split()]
    l = [int(i) for i in input().split()]
    ans = 1
    m = 0
    for i in l:
        m += i
        if m <= n[1]:
            ans += 1
        else:
            break
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N,X=(int(x) for x in input().split())
location=0
count=1
bound=[]
for x in input().split():
    bound.append(x)
for i in range(N):
    location+=int(bound[i])
    if(location<=X):
        count+=1
    else:
        break
print(count)

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

ans = 1
count = 0

for i in l:
    count += i
    if count <= x:
        ans += 1

print(ans)

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

Solution (Python):
N, X = map(int, input().split(" "))
Llist = list(map(int, input().split(" ")))
ans = 1
now = 0
for i in range(N):
    now += Llist[i]
    if now > 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 i in range(len(L)):
   D += L[i]
   if D <= X:
       cnt += 1
   else:
       break

print(cnt)

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

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

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

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


debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)



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

    d = 0
    count = 1
    for l in l_list:
        d = d + l
        if d <= x:
            count += 1
        else:
            break
    print(count)

solve()

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

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

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

lsum = 0
ans = 1
for i in l:
    lsum = lsum+i
    if lsum <= x:
        ans = ans + 1
    else:
        break

print(ans)

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

print(cou)

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

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

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

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

D = [0]
prev = 0

for i in range(1, N+1):
    cur = prev + L[i-1]
    D.append(cur)
    if cur > X:
        print(i)
        break
    prev = cur
else:
	print(N+1)

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

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

D = []
D.append(0)

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

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

num = [int(a) for a in input().split()]

ans = 0
cnt = 1
for i in range(n):
    ans = ans + num[i]
    if ans > x:
        break

    cnt += 1

print(cnt)

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

ans = 1
point = 0

for L in Lli:
    point = point + L
    if point <= X:
        ans = ans + 1
    else:
        break

print(ans)

Solution (Python):

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

sum_ = 0

ans = 0

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

print(ans)

Solution (Python):


from itertools import accumulate

def solve():
    N, X = map(int, input().split())
    *L, = filter(X.__ge__, accumulate(map(int, input().split())))
    res = len(L)+1
    return str(res)

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

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

Solution (Python):


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

    d = [0] + [l for l in L]
    for i in range(1, len(d)):
        d[i] = d[i-1] + L[i-1]
    a = [x for x in d if x <= X]
    print(len(a))


if __name__ == '__main__':
    main()

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

Solution (Python):

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

now_position = 0
count = 1
for L in L_li:
    now_position += L
    if now_position > X:
        break
    count += 1

print(str(count))

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

Solution (Python):
ll= lambda : list(map(int,input().split()))
testcases=1

for testcase in range(testcases):
	[n,x]=ll()
	l=ll()
	d=[0]
	for i in range(0,n):
		d.append(d[-1]+l[i])
	ans=0
	for i in d:
		if i <= x:
			ans+=1
	print(ans)

Solution (Python):

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

d = 0
jump = [0]
for i in range(n):
    d = d + L[i]
    if d <= x:
        jump.append(d)
    else:
        break

print(len(jump))

Solution (Python):
hoge = input().split()
N = int(hoge[0])
X = int(hoge[1])
L = []
huga = input().split()
for i in range(N):
  L.append(int(huga[i]))
  
now = 0
count = 1
for i in range(len(L)):
  now += L[i]
  if now <= X:
    count += 1

print(count)

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

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

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

Solution (Python):
from itertools import accumulate

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

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

print(len([_ for _ in tmp if _ <= X]))

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

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

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

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

print(count+1)

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

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

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

print(ans)

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

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

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 = ans + 1

print(ans)

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

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

Solution (Python):

n, x = list(map(int, input().rstrip().split()))
lst = list(map(int, input().rstrip().split()))
cur, ans = 0, 0
for i in lst:
    if cur <= x:
        ans += 1
    cur += i
print(ans + 1 if cur <= x else ans)

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

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

print ans

Solution (Python):
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True 
def ddprint(x):
  if DBG:
    print(x)

n,x = inm()
l = inl()
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 = list(map(int,input().split()))
cnt = 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:
        cnt += 1
print(cnt)

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

ans,x = 1,0

for l in L:
  x += l
  if x > M:
    break
  ans += 1

print(ans)

Solution (Python):

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

Solution (Python):


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

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

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

count = 1
position = 0

while L and position <= X:
    position += L.pop(0)
    if position <= X:
        count += 1

print(count)

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

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

print(ans)

Solution (Python):
import sys

from sys import setrecursionlimit
setrecursionlimit(10**9)

def inpl(): return list(map(int, input().split()))
N, X = inpl()
L = inpl()[::-1]
D = 0
ans = 1
D += L.pop()
while D <= X:
    ans += 1
    if len(L):
        D += L.pop()
    else:
        break
print(ans)

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

for i in l:
    plc += i
    if plc <= x:
        cnt += 1

print(cnt)

Solution (Python):


import sys
def input(): return sys.stdin.readline().strip()


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


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

aa = 0
for a in ans:
    if a <= X:
        aa += 1

print(aa)

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

L = map(int, raw_input().split())

bound_count = 1
sum_L = 0

for l in L:
    sum_L += l
    if sum_L > X:
        break
    bound_count += 1
print bound_count

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

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

ball = 0
cnt = 0

for l_i in l:
    ball += l_i
    if ball <= x:
        cnt += 1

print(cnt)

Solution (Python):
import numpy as np
n, x = map(int, input().split())
l_arr = np.array(list(map(int, input().split())))
print((np.cumsum(l_arr) <= x).sum() + 1)

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

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

L.append(0)

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

ans = 0
for i in s:
    if i<=X:ans+=1

print(ans)

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

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

print(cnt+1)

Solution (Python):
from itertools import accumulate
from sys import stdin
N, X = [int(_) for _ in stdin.readline().rstrip().split()]
L = [int(_) for _ in stdin.readline().rstrip().split()]
L = [0]+list(accumulate(L))
print(len([l for l in L if l <= X]))

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

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

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

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

print(cnt)

Solution (Python):

import sys
import math
import numpy as np
import itertools



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



l = [int(i) for i in input().split()] 
a=0
answer = 1
for i in range(n):
    if l[i]+a > x:
        break
    else:
        answer += 1
        a += l[i]

print(answer)

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

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

print(cnt)

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

i, Y = 0, 0
while i < N:
    if Y + L[i] <= X:
        Y += L[i]
        i += 1
    else:
        break
print(i + 1)

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

count = 1
num = 0
for i in range(N):
    num += list1[i]
    if num<=X:
        count+=1
    else:
        break
print(count)

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

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

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

bound = 1

now_pos = 0
for L in LX:
    now_pos = now_pos + L
    if now_pos <= X:
        bound += 1
    else:
        break
print(bound)

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

Solution (Python):



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

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

'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
d = 0
count = 1
for i in range(n):
    d += l[i]
    if d <= x:
        count += 1
    else:
        break
print(count)

Solution (Python):
import sys

fin = sys.stdin.readline
N, X = [int(elem) for elem in fin().split()]
l_list = [int(elem) for elem in fin().split()]

count = 1
current_d = 0
for l in l_list:
    current_d += l
    if current_d > X:
        break
    count += 1
print(count)

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

Solution (Python):
import math


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


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




kotae = 1
total = 0

for i in range(n) :
    if (total + list[i] > m) :
        break
    total += list[i]
    kotae += 1

print(kotae)

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

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

print(ans)

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

Solution (Python):


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

l = list(map(int, input().split()))
a = []
for i in range(n+1):
    if i == 0:
        a.append(0)
        continue
    a.append(a[i-1]+l[i-1])

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

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

for l in l_list:
    d += l
    if d > x:
        break
    bound += 1
print(bound)

Solution (Python):
def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    for i in range(N+1):
        D = sum(L[:i])
        if D > X:
            print(i)
            return
    print(N+1)
    return


if __name__ == '__main__':
    main()

Solution (Python):

N, X = map(int, input().split())
L = map(int, input().split())
ans = 1
le = 0
for l in L:
    le += l
    if le > X:
        break
    ans += 1
print(ans)

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

Solution (Python):
import sys

input = sys.stdin.readline

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

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

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

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

print(count)

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

Solution (Python):

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

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

count = 1
dis = 0

for l in ls:
    new_dis = dis + l
    if(new_dis <= X):
        count += 1
        dis  = new_dis
    else:
        break

print(count)

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

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

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

Solution (Python):

N, X = map(int, input().split())
L_list = list(map(int, input().split()))
btimes = 1
longs = 0
for idx, ite in enumerate(L_list):
    longs += ite
    if longs > X:
        break
    btimes += 1
print(btimes)