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()))
D=0
i=0
for i in range(N):
    D=D+L[i]
    if D<=X:
        i=i+1
        continue
    else:
        break
print(i+1)

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

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

tmp = 0
p = [0]
for e in l:
    p.append(e + tmp)
    tmp += e
    
count = 0
for e in p:
    if x >= e:
        count += 1

print(count)

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

print(ans)

Solution (Python):

import sys


def solve(N: int, X: int, L: "List[int]"):
    d = 0
    ret = 1
    for l in L:
        d += l
        if d <= X:
            ret += 1
    print(ret)
    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):
s = input().split()
N = int(s[0])
X = int(s[1])
ss = input().split()
L = [0]*(N+1)
for i in range(N):
    L[i] = int(ss[i])
    
D = 0
count =0
for i in range(N+1):
    D = D+L[i]
    count = count+1
   
    if D > X:
        break
        
print(count)

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

    print(solve(x, l))
    
def solve(x, l):
    pos = 0
    c = 0
    if x >= 0:
        c += 1
    
    for li in l:
        pos += li
        if pos <= x:
            c += 1

    return c

main()

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

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

print(cost)

Solution (Python):
n,x = map(int, input().split())
L = list(map(int, input().split()))
loc = 0
i = 1
while loc <= x:
    if i < n+1:
        loc += L[i-1]
    else:
        i += 1
        break
    i += 1
print(i-1)

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

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

print(count)

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

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

al = [0,l[0]]
for i in range(len(l)-1):
    if i == 0:
        an = l[i] + l[i+1]
    else:
        an += l[i+1]
    al.append(an)

count = 0
for k in al:
    if k <= x:
        count += 1
            
print(count)

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

count = 1
cur = 0
while len(ls) > 0:
    cur += ls.pop()
    if cur <= x:
        count += 1
    else:
        break

print(count)

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

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

counter = 1

D =0

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

print(counter)

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

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

if num <= X:
    print(len(L)+1)

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


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

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

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

count=1
for j in range(n):
    if d_list[j]<=x:
        count+=1
print(count)

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

point=0
count=1
for i in li:
  point += i
  if point<=X:
    count+=1
print(count)

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

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

ans = 1

sum_L = 0


for i in range(N):
	sum_L += L[i]
	if(sum_L > X):
		break;
	else:
		ans += 1

print(ans)

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

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

Solution (Python):
N, X = map(int,input().split())
lLst = list(map(int, input().split()))
D = 0
ansLst = []
ansLst.append(D)
tmp1 = 0
for i in range(N):
    tmp = tmp1 + lLst[i]
    if tmp <= X:
        ansLst.append(tmp)
        tmp1 = tmp
    else:
        break

print(len(ansLst))

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

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

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

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

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

Solution (Python):
import sys, re




from copy import deepcopy,copy




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

lis = MAP()

d = 0
ct = 1

for y in lis:
    d += y
    if d > x:
        print(ct)
        break
    else:
        ct += 1
else:
    print(n+1)

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

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

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

Solution (Python):
N, X = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
L = 0
count = 0
flag = 0
for i in a:
    L += i
    count += 1
    if L > X:
        print(count)
        flag = 1
        break
if flag == 0:
    print(count+1)

Solution (Python):
x, y = list(map(int, input().split()))
bola = 0
bola1 = 0
quick = 1

l1 = input().split()

for c in range(x):
    bola1 = int(l1[c])

    bola += bola1

    if bola <= y:
        quick += 1

print(quick)

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

Solution (Python):



NX = input().split(' ')
N = int(NX[0])
X = int(NX[1])
L = map(int, input().split(' '))

LL = list()
LL.append(0)
n = 0
for l in L:
    n += l
    LL.append(n)

LL = list(filter(lambda x: x <= X, LL))
print(len(LL))

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

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

count = 1
d = 0
for i in range(n):
  d += l_s[i]
  if d <= x:
    count = i + 2
  else:
    break

print(count)

Solution (Python):



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

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

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

if count == N+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):
    if d+L[i] <=x:
        cnt+=1
        d=d+L[i]
    else:
        break

print(cnt)

Solution (Python):
import numpy as np

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

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

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

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

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

Solution (Python):
n,x = map(int,input().split())
l = list(map(int,input().split()))
counter = 0
now = 0
cum = [0]
for i in range(n):
    cum.append(cum[i]+l[i])

for i in range(n+1):
    if cum[i] <= x:
        counter += 1
    else:
        break
print(counter)

Solution (Python):

n,x=map(int,input().split())
lst=map(int,input().split())
_lst=[0]
for l in lst:
    _lst.append(_lst[-1]+l)

num=0
for l in _lst:
    if l<=x:
        num+=1
    else:
        break
print(num)

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

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

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

d = 0
jumps = [0]
for i in range(len(L)):
    d = d + L[i]
    jumps.append(d)
    
cnt = 0
for x in jumps:
    if x <= X:
        cnt += 1
    else:
        pass
    
print(cnt)

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

s=list(map(int,input().split()))
i=0
ans=0
l=0
while l<=x:
    try:

       l=l+s[i]
       ans+=1
       i+=1
    except:
        ans+=1
        break
print(ans)

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

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

bond = [0]
last = 0

for i in range(n):
    last = l[i] + last
    bond.append(last)



count = 0 
for i in bond:
    if i <= x:
        count +=1

print(count)

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

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

Solution (Python):

"""
Created on Sun Jun 16 20:56:28 2019

@author: Yamazaki Kenichi
"""

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

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

print(i+1)

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

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

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

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

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

print(count)

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


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

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

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

cnt = 1
p = 0
for i in range(len(li)):
    p += li[i]
    if p > x:
        break
    else:
        cnt += 1

print(cnt)

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

cnt = 0
ans = 1
for i in L:
	cnt += i
	if X >= cnt:
		ans += 1

print(ans)

Solution (Python):
import bisect

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

D = [0] * (N + 1)

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

Solution (Python):
n, x = map(int, input().split())
ls = list(map(int, input().split()))
bounds = [0]
count = 0

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



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

print(count)

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

x = 0
score = 1
for i in L:
    x += i
    if x <= X:
        score += 1


print(score)

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

count = 0
prev = 0
now = 0
for l in ls:
    now = prev + l
    if now <= x:
        count += 1
    else:
        break
    prev += l

print(count + 1)

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

Solution (Python):
i = list(map(int, input().split()))
j = list(map(int, input().split()))

N = i[0]
X = i[1]

d = 0
bound = 0

for L in j:
    d = d + L
    if d <= X:
        bound+=1
print(bound+1)

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

print(cnt)

Solution (Python):

import sys


def solve(N: int, X: int, L: "List[int]"):
    d = [0]*(N+1)
    for i in range(1,N+1):
        d[i] = d[i-1] + L[i-1]

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

    print(ans)
    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 =  [int(i) for i in input().split()]
total_dis = 0
counter = 1

for i in range(1, N + 1):
    total_dis += L_list[i - 1]
    if total_dis <= X:
        counter += 1
    else:
        break
print(counter)

Solution (Python):
n,x=map(int,input().split())
l=list(map(int,input().split()))
cnt=1
d=0
for i in 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()))



D = [0]
count = 1



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

print(count)

Solution (Python):

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


d = 0
ans = 1

for l_e in l:

    d += l_e

    if d > X:
        break
    else:
        ans += 1



print(ans)

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

D=0
dis = 0
count = 1
for i in L:
    D += i
    if D <= X:
        count += 1

print(count)

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

b = 1
sm = 0
for elu in L:
    sm += elu
    if sm > X:
        break
    b += 1

print(b)

Solution (Python):
import sys
def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A

N, X = InputToInt()
A = InputToInt()

P = 0
for i in range(N):
    P += A[i]
    if P > X:
        print(i+1)
        sys.exit()
print(N+1)

Solution (Python):
import sys
n, x = map(int,input().split())
lList = list(map(int,input().split()))
counter = 1
position = 0
for i in lList:
  position += i
  if position <= x:
    counter += 1
  else:
    print(counter)
    sys.exit()
print(counter)

Solution (Python):
n, x = map(int, input().split())
llist = [0] + list(map(int, input().split())) + [1e9]
for i in range(1, n+2):
  llist[i] += llist[i-1]

for i in range(n+2):
  if llist[i] > x:
    break
print(i)

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

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

if cum <= X:
    cnt += 1

print(cnt)

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

print("{}".format(ans))

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

total = 0
count = 1
for i in li:
  total += i
  count += 1
  if total == x:
    print(count)
    exit()
  if total > x:
    print(count-1)
    exit()
  
print(len(li)+1)

Solution (Python):
from sys import stdin
import numpy as np










N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = [int(x) for x in stdin.readline().rstrip().split()]
cnt = 1
n = 0
for l in L:
  n += l
  if n>X:
    break
  cnt += 1
print(cnt)

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

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

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

Solution (Python):
from heapq import heappush, heappop, heapify, heapreplace
from collections import defaultdict


class Solution:
    def main(self):
        N, X = map(int, input().split())
        L = [0] + list(map(int, input().split()))
        cum = 0
        res = 0
        for i in range(len(L)):
            cum += L[i]
            if cum <= X:
                
                res += 1
            else:
                break

        print(res)

if __name__ == '__main__':
    Solution().main()

Solution (Python):
from itertools import accumulate
from bisect import bisect
n,x = map(int,input().split())

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

D = [0]+list(accumulate(L))
i = bisect(D, x)
print(i)

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

Solution (Python):
import itertools

count = 1
a,b=map(int,input().split())
lst=list(map(int,input().split()))
for i in itertools.accumulate(lst):
    if i <= b:
        count += 1
print(count)

Solution (Python):
def main():
    inputs = input().split()
    N, X = int(inputs[0]), int(inputs[1])
    L = list(map(int, input().split()))

    D_old = 0.0
    count = 1
    for l in L:
        D = D_old + l
        if D <= X:
            count += 1
        D_old = D
    print(count)

if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

print(ans)

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

Solution (Python):
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
t = 1
while(True):
    if t == N+1:
        break
    D.append(D[t-1]+L[t-1])
    if D[t] > X:
        break
    else:
        t += 1

print(t)

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

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

flag = True
D = 0
for i in range(N):
    D += Ls[i]
    if D > X:
        print(i+1)
        flag = False
        break

if flag == True:
    print(N+1)

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

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


print(count)

Solution (Python):

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

flag = True
d = 0
for i in range(n):
    d = d + ls[i]
    if d > x:
        flag = False
        break

if flag:
    print(i + 2)
else:
    print(i + 1)

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

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

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

while Di<=X:
    result+=1
    if result==N+1:
        break
    Di+=L[result-1]

print(result)

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

Solution (Python):

import sys

import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

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

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

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

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

for j in l:
    if t <= x:
        ans += 1
    t += j

if t <= x:
    ans += 1

print(ans)

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

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

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

d = 0
for i, l in enumerate(L, 1):
    d += l
    if d > X:
        break
else:
    i += 1

print(i)

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

c=1
i=0
for j in l:
  i += j
  if i>x:
    break
  else:
    c+=1
print(c)

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

D = 0
c = 1

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

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

Solution (Python):



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

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


print
count = 1

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

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

D = 0
count = 1

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

print count

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

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

cnt = 1
x = 0

for v in L:
    x += v

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

print(cnt)

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

print(cnt)

Solution (Python):

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

ans = 1
now = 0
for _ in lis:
    now += _
    if x >= now:
        ans += 1
    else:
        break
print(ans)

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

Solution (Python):

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

Solution (Python):
N,X = map(int,input().split())
ls = []
ls = list(map(int,input().split()))
an = []
an.append(0)
for i in range(len(ls)):
    if i == 0:
        an.append(ls[i])
    else:
        an.append(ls[i] + an[i])
p = 0

for j in an:
    if j <= X:
        p+=1
print(p)

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


cnt = 1
d = 0

for i in range(len(l)):
  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(" ")))

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

print(ans)

Solution (Python):
def main():
    data = input().split()
    N = int(data[0])
    X = int(data[1])
    L = input().split()
    num = 1
    D = 0
    for i in range(N):
        D += int(L[i])
        if D <= X:
            num += 1
        else:
            break
    print(num)

if __name__ == "__main__":
    main()

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

print cnt

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

Solution (Python):
from itertools import accumulate
from bisect import bisect
from sys import stdin

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

    l = list(accumulate(L))
    print(bisect(l, X) + 1)

input = lambda: stdin.readline()
main()

Solution (Python):
N,X = map(int, raw_input().split())
L = map(int, raw_input().split())
t = 1
now = 0
for i in L:
	now += i
	if(now > X):
		break
	t += 1
print(t)

Solution (Python):
import collections as c
ip = lambda : map(int, input().split())

mod = 1e9+7
N, X = ip()
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()))

s = 0

for i in range(n):
  s += l[i]
  if s > x:
    print(i+1)
    break
  elif i == n-1:
    print(n+1)

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

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

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

cnt = 1
tmp = 0
for i in L:
    tmp += i
    if tmp <= X:
        cnt += 1

print(cnt)

Solution (Python):

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

y = 0
rtn = 1
for ii in lll:
    y += ii
    if (y <= x):
        rtn += 1


print(rtn)

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=raw_input().split()
n,x=int(n),int(x)
l=map(int,raw_input().split())
r=1
s=0
for i in range(n):
  s+=l[i]
  if s<=x:
    r+=1
  else :
    break
print r

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

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


print(ans)

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

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

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

count = 1
d = 0

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

print(count)

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



ans = 1
Before_Di = 0

for i in range(N):
  Di = Before_Di + L_list[i]
  
  if Di<=X:
    ans+=1
    Before_Di = Di
  else:
    break
    
print(ans)