peterverebics/CodeNet_Python_118 huggingface dataset:
N, X = map(int, input().split())
l = list(map(int, input().split()))
d = 0
answer = 0
for i in range(len(l)):
    if d <= X:
        answer += 1
        d += l[i]
    else:
        break
print(answer)
n, x = map(int,input().split())
l = list(map(int,input().split()))

a = 0
for i in range(n):
    a = a + l[i]
    #print(a)
    if x == a:
        print(i+1+1)
        break
    elif x <= a:
        print(i+1)
        break
    else:
        continue
    print(i+2)
count=0
a=0
n,x = map(int,input().split())
li = list(map(int,input().split()))
for i in range(n):
    if (a<=x):
        a=a+li[i]
        count+=1
print(count)
n, x = map(int,input().split())
l = list(map(int,input().split()))

d = 0
count = 1
for i in range(n):
    d += l[i]
    if d < x:
        count += 1
    elif d == x:
        print(count+1)
        quit()
    else:
        print(count)
        quit()
r=input().split()
N=int(r[0])
X=int(r[1])
d=[int(s) for s in input().split()]
ans=1
le=0
for i in range(N):
    le+=d[i]
    if le>X:
        print(ans)
        break
    else:
        ans+=1
n,x=map(int,input().split())
l=[int(i) for i in input().split()]
d=0
ans=n+1
for i in range(n):
    d=d+l[i]
    if d>x:
        ans=i
        break
print(ans+1)
N,X=map(int,input().split())

arr=list(map(int,input().split()))
a=0
ans=0

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

print(ans)
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
count = 0
for i in range(0,N):
  if D<=X:
    count+=1
    D+=L[i]
  else:
    break
print(count)
import math
def main():
    t = [int(t)for t in input().split()]
    n,x = t[0],t[1]

    l = [int(t)for t in input().split()]
    d = [0]

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

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

    print(result)
    

if __name__ == "__main__":
    main()
N, X = map(int, input().split())
L = list(map(int, input().split()))
temp = 0
for i in range(N):
    temp += L[i]
    if temp > X:
        break
print(i+1)
#130

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

res = 1
sm = 0
for i in range(1,n):
    if sm + l[i] <= x:
        res += 1
    sm =+ l[i]
print(res)
n,x=map(int,input().split())
L=list(map(int,input().split()))
cnt=0
ans=0
for l in L:
    if cnt>x:
        break
    cnt+=l
    ans+=1
print(ans)
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = list()
D.append(0)
count = 1
Dplus=0
for i in range(1,N):
    Dplus=D[i-1]+L[i-1]
    D.append(Dplus)
    #print(D[i])
    if D[i]<=X:
        count+=1
    else:
        break
print(count)
N,X=map(int,input().split())
L=list(map(int,input().split()))
Y=[0]
D=0
while D<=X:
    for i in range(0,N):
        D=D+L[i]
        Y.append(D)
if Y[len(Y)-2]==X:
    print(len(Y)-1)
else:
    print(len(Y)-2)
n, x = map(int,input().split())
l = list(map(int,input().split()))

d = 0
count = 1
for i in range(n):
    d += l[i]
    if d > x:
        print(count)
        break
    elif d == x:
        print(count+1)
        break
    count += 1
N, X = map(int, input().split())

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

cumsum = 0

for n in range(N):
    cumsum += L[n]
    if cumsum == X:
        print(n+2)
        exit()
    if cumsum > X:
        print(n+1)
        exit()
N,X = map(int,input().split())
L = [int(i) for i in input().split()]
D = 0
count = 0
for n in L:
    D += n
    count += 1
    if D > X or count > N + 1:
        break
print(count)
N, X = map(int, input().split())

L = list(map(int, input().split()))
D = 0
count = 0

for i in L:
  D += i
  count += 1
  if D > X:
    print(count)
    exit(0)
n, x = map(int, input().split())
l = list(map(int, input().split()))
cnt = 1
d = 0
for i in range(n):
    cnt += 1
    d += l[i]
    if d > x:
        break
print(cnt)
N,X=map(int,input().split(" "))
L=[int(s) for s in input().split(" ")]

Sum=0
Count=0
while Sum<=X:
    Sum+=L[Count]
    Count+=1
    if Count==N:
        Count==N+1
        break
    
print(Count)
N,X = map(int, input().split())
L = list(map(int, input().split()))

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

cnt = 1
position = 0

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

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

# 累積和 cumulative sum
ans = 0
cumul = [0]
for i, l in enumerate(L):
  d = cumul[-1] + l
  if d > X:
    #print(i, d)
    ans = i + 1
    break
  cumul.append(d)

#print(cumul)
print(ans)
N,X=map(int,input().split())
length=list(map(int,input().split()))
ans=0
D=0

for i in length:
    if D<=X:
        ans+=1
        D = D + i
print(ans)
n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 1
pos = 0
for i in l:
    pos += i
    if pos>x:
        print(ans)
        break
    ans += 1
n, x = map(int, input().split())

l = list(map(int, input().split()))
d = [0]
for i in range(n):
    if((d[i] + l[i]) > x):
        print(len(d))
        break
    d.append(d[i] + l[i])
n , x = map(int,input().split())
L =list(map(int,input().split()))
ans = 1
D = [0]*(n+1)
for i in range(1,n-1):
    D[i+1] = D[i] + L[i-1]
    if D[i+1] <=x:
        ans+=1
print(ans)
n,x = map(int, input().split())
l = list(map(int, input().split()))
flag = 0
d = []
d.append(0)
for i in range(1,n):
    if d[i-1]+l[i-1] > x:
        break
    else:
        d.append(d[i-1]+l[i])
print(len(d))
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=0
cnt=0
for i in range(N):
    if D<=X:
        cnt+=1
        D +=L[i]
    else:
        break

print(cnt)
n,x=map(int, input().split())
l=list(map(int, input().split()))
c=0
b=0
for i in range(n):
    if b<=x:
        b+=l[i]
        c+=1
    else:
        break
print(c)
n,x=map(int, input().split())
l=list(map(int, input().split()))
c=0
b=0
if l[0]>x:
    print(0)
else:
    for i in range(n):
        if b<=x:
            b+=l[i]
            c+=1
        else:
            break
print(c)
N, X = map(int, input().split())
nums = [int(i) for i in input().split()]

count = 0
for idx in range(N):
    while count <= X:
        count += nums[idx]

if count == X:
    print(idx + 2)

else:
    print(idx + 1)
n, x = (int(i) for i in input().split())
list_l = [int(j) for j in input().split()]
tmp = 0
count = 0
for i in range(0, n + 1):
    if i == 0: continue
    else:
        tmp += list_l[i - 1]
        count += 1
        if tmp > x:
            break
print(count)
N,X = map(int, input().split())
L = list(map(int, input().split()))
count = 0
D = 0

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

print(count)
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)
# -*- coding: utf-8 -*-
"""
Created on Tue May 12 00:21:28 2020

@author: shinba
"""

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

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

i = 0
ans = 0

for j in range(n):
    if i <= x:
        ans += 1
        i += L[j]
        continue
    else:
        print(ans)
        break
else:
    print(ans+1)
n,x=map(int,input().split())
l=list(map(int,input().split()))
i,d=1,0
while(i<n):
  d+=l[i-1]
  if d<=x:
    i+=1
  else:
    break
print(i)
N,X = map(int,input().split())
L = list(map(int,input().split()))
List = [0]*(N+1)
for i in range(1,N+1):
    List[i] = List[i-1] + L[i-1]
print(List)
import bisect  
# A = [i for i in List if i <=X]
# print(len(A))
print(bisect.bisect_left(List,X+1))
n, x = map(int, input().split())
l = list(map(int, input().split()))
cnt = 0
d = 0
for i in range(n):
    cnt += 1
    d += l[i]
    if d > x:
        break
print(cnt)
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]
for i in range(1, n+1):
    d.append(d[i-1] + l[i -1])
    if d[i] <= x:
        continue
    else:
        print(i)
        exit()
a, b = map(int, input().split())
L = list(map(int,input().split()))
c = 0
d = 0
for i in range(a):
    if c <= b:
        c = c + L[i]
        d = d+1
    else:
        break
print(d)
n, x =map(int,input().split())
l = list(map(int,input().split()))
d = 0
for i in range(n):
    d += l[i]
    if d > x:
        print(i + 1)
        break
n, x = map(int, input().split())
l = list(int(i) for i in input().split())
d = 0
cnt = 0
for i in range(n):
    d += l[i]
    cnt += 1
    if d > x:
        break
print(cnt)
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
cnt = 0
for i in range(n+1):
	cnt += 1
	if i <n:
		d += l[i]
	if x < d:
		print(cnt)
		exit()
# coding: utf-8
# Your code here!
N,X=map(int, input().split())
List=list(map(int, input().split()))
i=0
bow=0
while bow<=X and i<N:
    bow+=List[i]
    i+=1
print(i)
N,X=map(int,input().split())
L=list(map(int,input().split()))
mem=0; ans=0
for i in L:
    if mem<X: ans+=1
    mem+=i
print(ans)
n,x = map(int,input().split())
l=list(map(int,input().split()))

plot=0
cnt=0

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

print(cnt)
n,x = map(int,input().split())
l = list(map(int,input().split()))
bound = []
bound.append(0)

for i in range(1,n+1):
  tmp = bound[i-1] + l[i-1]
  bound.append(tmp)
#bound.sort()
ans = 0
for i in range(0,n):
  if(bound[i] <= x):
    ans += 1
  else:
    break
print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 0
    cumsum = 0
    for i in l:
        cumsum += i
        ans += 1
        if cumsum > x:
            print(ans)
            return
    
if __name__ == '__main__':
    main()
N, X = map(int,input().split())
L = list(map(int,input().split()))

D = [0]

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

print(len(D))
n, x = map(int, input().split())
num = list(map(int, input().split()))
d = 0
cnt = 0
for i in range(n):
  d += num[i]
  cnt += 1
  if d > x:
    print(cnt)
    exit()
n,x=map(int,input().split())
l=list(map(int,input().split()))
temp=[0]*(n+1)
for i in range(0,n):
  temp[i+1]=temp[i]+l[i]
import bisect
print(bisect.bisect_left(temp,x))
N,X = map(int,input().split())
l = list(map(int,input().split()))

sum=0
for i in range(N-1):
    if sum>X:
        print(i)
        exit()
    sum += l[i]
print(N+1)
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
ans=0
i=0
for i in range(n):
  if d<=x:
    d+=l[i]
    ans+=1
    #print(d)
  else:
    break
  
print(ans)
N,X = map(int, input().split())
L = list(map(int, input().split()))
count = 0
D = 0

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

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

D = [0] * (N+2)
for i in range(2, N+2):
    D[i] = D[i-1] + L[i-2]
    if D[i] > X:
        ans = i-1
        break

if D[-1] <= X:
    ans = N+1

print(ans)
n, x = map(int, input().split())
L = list(map(int, input().split()))
val = 0

for i, l in enumerate(L):
    val += l
    if val > x:
        print(i+1)
        break

if val == sum(L):
    print(len(L))
a,b = list(map(int,input().rstrip().split()))
t  =list(map(int,input().rstrip().split()))
m = 0
for i in range(a):
  m = m + t[i]
  if m > b:
    print(i)
    break
import bisect
n, x = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
ans = 1
for i in range(1, n+1):
  d = D[i-1] + L[i-1]
  D.append(d)
  if d <= x:
    ans += 1
  else:
    print(ans)
    break
n, x = map(int, input().split())
l=list(map(int, input().split()))

dis=0

for i in range(n):
    dis += l[i]
    if dis > x:
        print(i+1)
        exit(0)
    else:
        pass
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
def ll():
    return list(map(int,input().split()))
def l():
    return int(input())
n,x = ll()
l = ll()
d = 0
count=0
for i in range(n):
    if d<=x:
        count+=1
        d +=l[i]
    
print(count)
N, X = map(int, input().split())
L = list(map(int, input().split()))

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

print(ans)
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=[0]*(n+1)
ans=0
for i in range(n):
  d[i+1]=d[i]+l[i]
for i in range(n):
  if d[i]<=x:
    ans+=1
print(ans)
n,y=map(int,input().split())
lst=list(map(int,input().split()))
cnt=0
sum_lst=0
for i in range(1,n+1):
  cnt+=1
  sum_lst+=lst[i-1]
  if y==0:
    print(1)
    break
  if sum_lst>=y:
    print(cnt)
    break
N,X=map(int,input().split())
L=list(map(int,input().split()))


if L[0]>X:
    print(1)
else:
    D=0
    i=0
    count=1
    while D<=X and i<=N-1:
        print(D)
        if D+L[i]<=X:
            D+=L[i]
            i+=1
            count+=1
        else:
            break
    print(count)
url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    count = 0
    pos = 0
    for l in lis:
        if pos > x:
            print(count) if count > 0 else print(1)
            exit()
        pos += l
        count += 1

if __name__ == '__main__':
    main()
n,x=map(int,input().split())
l=list(map(int,input().split()))
sumd=0
for i in range(n):
  sumd+=l[i]
  if sumd>x:
    break
print(i+1)
N,X=map(int,input().split())
L=list(map(int,input().split()))
c=0
tmp=0
for i in range(N):
  if tmp <=X:
    c+=1
  tmp += L[i]
print(c)
def function(N, L, X):
    D = [0]
    for i in range(1, N+1):
        D.append(D[i-1]+L[i-1])
        if D[-1] > X:
            return i

line = input()
N, X = [int(n) for n in line.split()]
line = input()
L = [int(n) for n in line.split()]
print(function(N, L, X))
n,x = map(int, input().split())
ll = list(map(int, input().split()))
cnt = 0
v = 0
for l in ll:
    v += l
    cnt += 1
    if v > x:
        break

print(cnt)
n, x = map(int, input().split())
l = [0] + list(map(int, input().split()))

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

print(ans)
n,x=map(int,input().split())
L=list(map(int,input().split()))
f=0
for i in range(n):
  if sum(L[a] for a in range(i))<=x:
    f+=1
print(f)
n,x= input().split()
b_list= list(map(int, input().split()))
temp = 0
counter = 0
for i in range(int(n)):
    if (temp<=int(x)):
        counter +=1
    temp += b_list[i]

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

za = 0
count = 1

while za <= X and count <= N:
  count += 1
  za += L[count-2]
  
print(count-1)
n = list(map(int, input().split()))
m = list(map(int, input().split()))

ans = 0
new_list = [0]
for i in range(n[0] - 1):
  ans = ans + m[i]
  if ans <= n[1]:
    new_list.append(ans)
  elif ans > n[1]:
    break
    
print(len(new_list))
n, x = map(int, input().split())
l = list(map(int, input().split()))
res = 0
for i in range(n):
    res += l[i]
    if x < res:
        print(i+1)
        break
n, x = map(int,input().split())
l = list(map(int,input().split()))

SUM = 0
cnt = 1
for i in l:
    SUM += i
    if SUM > x:
        print(cnt)
        exit()
    cnt += 1
#ABC130 B

N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0]
count = 0
for i in range(1,N+1):
    D.append(D[i-1]+L[i-2])
    if D[i]<= X:
        count += 1

print(count + 1)
import itertools

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

dl = [0] + list(itertools.accumulate(ll))

for i in range(len(dl)):
    if dl[i] > x:
        print(i)
        break
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
    sumL += x
print(count)
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
e = 1
for i in range(1,n):
  if d + l[i] <= x:
    e += 1
    d = d + l[i]
print(e)
n,x = map(int,input().split())
l = list(map(int,input().split()))
a = 0
l.append(0)
if len(l) % 2 == 0:
  for i in range (0,len(l)-1):
    if l[i]+l[i+1]<= x:
      a +=1
  print(a+1)
else :
  for i in range (0,len(l)-1):
    if l[i]+l[i+1]<= x:
      a +=1
  print(a)
n,x = map(int,input().split())
L = list(map(int,input().split()))
cnt = 0
d = 0
while d <=x and cnt <len(L):
    d +=L[cnt]
    cnt += 1
print(cnt)
n, x = map(int, input().split())
l = [int(s) for s in input().split()]

pos = 0
index = 0
while pos <= x:
    if index >= len(l):
        break
    pos += l[index]
    index += 1
print(index)
def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))

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

if __name__ == '__main__':
    main()
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if s<=k: ans+=1
  else: break
  s+=i
print(ans)
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0,L[0]]
count = 0
for i in range(2,N+2):
    D.append(D[i-1]+L[i-2])
for i in range(0,N+2):
    if D[i]<= X:
        count += 1

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

cnt=0
for i, li in enumerate(l):
    cnt += li
    if cnt > x:
        print(i+1)
        break
from itertools import accumulate
N, X = map(int, input().split())
Llist = list(accumulate(list(map(int, input().split()))))
for i in range(N):
    if Llist[i] > X:
        print(i + 1)
        break
n,x = map(int,input().split())
l = list(map(int,input().split()))
for i in range(n):
    if sum(l[:i])>x: break
print(i)
n, x = map(int, input().split())
l = list(map(int, input().split()))

cnt = 0
d = 0
while True:
    d += l[cnt]
    cnt += 1
    if d > x or cnt > len(l)-1:
        break
print(cnt)
n,x = map(int, input().split())
L = list(map(int,input().split()))
cnt = 0
for i in range(n):
  if(sum(L[:i]) <= x):
     cnt += 1 
print(cnt)
N, X = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]
ans = 0
prev = 0
for i in range(1, N + 1):
    D = prev + L[i - 1]
    if D <= X:
        ans += 1
    prev = i
print(ans)
N,X = (int(x) for x in input().split())
L = [int(x) for x in input().split()]
s = 0
i = 0
while (s <= X):
  if i >= N:
    print(N)
    quit()
  else:
    s = s + L[i]
    i = i + 1
print(i)
import math
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]
for i in range(1, n+1):
    d.append(d[i-1] + l[i -1])
    if x < d[i]:
        print(i)
        exit()
    else:
        continue
n, x = map(int, input().split())
a = [ int(x) for x in input().split() ]
cnt = 0
s = 0
for aa in a:
    if s <= x:
        cnt += 1
    s += aa

print(cnt)
abc = [int(e) for e in input().split()]
length = [int(e) for e in input().split()]

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

total_length = 0
count = 1

for i in range(len(length)):
    if total_length > X:
        count = count - 1
        break
    total_length = total_length + length[i]
    count = count + 1


if count > N:
    print(N)
else:
    print(count)
n,x = map(int,input().split())
a = list(map(int,input().split()))
count = 0
b = 0
for i in range(n):
    if b > x:
        break
    count+=1
    b+= a[i]
print(count)
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
ans=0
i=0
while d<=x and i<n:
  d+=l[i]
  i+=1
  ans+=1
  
print(ans)
import sys
N, X = map(int, input().split())
l = list(map(int, input().split()))
l.insert(0, 0)
val, count = 0, 0
for i in l:
    val += i
    if val <= X:
        count += 1
    else:
        print(count)
        sys.exit()
a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
d=0
e=0
for i in range(a):
  if d+c[i]<=b:
    d=d+c[i]
    e=e+1
print(e+1)
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

now = 0
cnt = 0
for l in Ls:
    if now>X:
        break
    now += l
    cnt += 1
else:
    cnt += 1
print(cnt)
from collections import deque

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

d, i = 0, 0
deq = deque(L)
while d <= x and len(deq) > 0:
    d += deq.popleft()
    i += 1

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


if L[0]>X:
    print(1)
else:
    D=0
    i=0
    count=0
    while D<=X and i<=N-1:
        D+=L[i]
        i+=1
        count+=1
    print(count)
N, X = map(int, input().split())
L = list(map(int, input().split()))

from itertools import groupby, accumulate, product, permutations, combinations
def solve(N,X,L):
    L = accumulate(L)
    ans = 1
    for i,l in enumerate(L):
        if l>X:
            ans += i
            break
    return ans
print(solve(N,X,L))
N,X = map(int,input().split())
L = list(map(int,input().split()))
counter = 0
total = 0
for l in L:
    if(total <=X):counter+=1
    total+=l
print(counter)
n, x = map(int,input().split())
l = list(map(int,input().split()))

cnt = 0
now = 0
while now <= x and l:
    cnt += 1
    now += l.pop(0)
print(cnt)
import math
def main():
    t = [int(t)for t in input().split()]
    n,x = t[0],t[1]

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

    i = 0
    s = 0
    while s<=x and i<n:
        s += l[i]
        i+=1

    print(i if i<n else i-1)

if __name__ == "__main__":
    main()
n,y=map(int,input().split())
lst=list(map(int,input().split())) 
lst=[0]+lst
cnt=0 
sum_lst=0 
for i in range(n+1): 
	sum_lst+=lst[i]
	if sum_lst>=y:
		cnt+=1
print(cnt-1)
import sys

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

ans = 0
for i, l in enumerate(L):
    ans += l
    if ans > X:
        print(i+1)
        break
else:
    print(N)
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()
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)
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)
# -*- coding: utf-8 -*-

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

i=2
D=0
while D <= X:
    D = D + L_list[i-2]
    ans = i-1
    i += 1
    
    if (i-2) > len(L_list)-1:
        break

print(ans)
n,x=list(map(int,input().split()))
l=list(map(int,input().split()))
d=[0]*n
d.append(0)
for i in range(1,len(l)+1):
    d[i]=d[i-1]+l[i-1]

for i in range(len(d)):
    if d[i]>x:
        print(i)
        exit()
#python3
n,x=map(int, input().split())
l=[int(i) for i in input().split()]
ans=0
d=0
for i in range(n):
  if d>x: 
    break
  d=d+l[i]
  ans+=1
print(ans)
N, X = map(int, input().split())
L = map(int, input().split())

sumL = 0
count = 0

for x in L:
    if sumL <= X:
        count += 1
    sumL += x
print(count)
#ABC 130B
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
cnt = 0
for i in l:
   if d <= x:
      d += i
      cnt += 1
print(cnt)
n,x = map(int,input().split())
l = list(map(int,input().split()))
for i in range(n+1):
    #print(sum(l[:i]))
    if sum(l[:i])>x:
        break
print(i)
a,b = list(map(int,input().rstrip().split()))
t  =list(map(int,input().rstrip().split()))
m = 0
for i in range(a):
  m = m + t[i]
  if m > b:
    print(i+1)
    break
  elif m == b:
    print(i+2)
    break