peterverebics/CodeNet_Python_118 huggingface dataset:
N,X=map(int,input().split())
L=list(map(int,input().split()))
S=[0]
sum_L=0
for i in range(N):
  sum_L+=L[i]
  S.append(sum_L)
counter=0
for i in range(N+1):
  if S[i]<=X:
    counter+=1
print(counter)
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d, cnt = 0, 1
for li in l:
    d += li
    if d <= x:
        cnt += 1
print(cnt)
n, x = map(int, input().split())
L = list(map(int, input().split()))
D = [0] * (n + 1)
ans = 1

for i in range(1, n + 1):
    D[i] = D[i - 1] + L[i - 1]

    if D[i] <= x:
        ans = ans + 1
    else:
        break

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

jump_point = [0]
tmp = 0
for point in list:
    tmp += point
    jump_point.append(tmp)

ans = 0
for i in jump_point:
    if i <= x:
        ans += 1

print(ans)
n,x,*l=map(int,open(0).read().split())
print(sum(x >= sum(l[:i+1])for i in range(n))+1)
N,X = map(int,input().split())
L = [int(i) for i in input().split()]
D = 0
count = 1
for n in L:
    D += n
    if D > X or count > N + 1:
        break
    count += 1
print(count)
line = input()
X, Y = [int(n) for n in line.split()]


line = input()
numbers = [int(n) for n in line.split()]

predicted_value = 1
for num in numbers:
    if Y - num >= 0:
        predicted_value += 1
        Y -= num
    else:
        break

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


if __name__ == '__main__':
    main()
N, X = map(int, input().split())
L = list(map(int, input().split()))
cnt = 0
if sum(L) <= X:
    print(N+1)
else:
    for i in range(N+1):
        if cnt <= X:
            cnt += L[i]
        else:
            print(i)
            break
n,x = map(int,input().split())
l = list(map(int,input().split()))
cnt = 1
t = 0
for v in l:
  t += v
  if t>x:
    break
  cnt += 1
print(cnt)
N,X = map(int,input().split())
L = list(input().split())
A = 0
count = 1
for i in range(N):
  A += int(L[i])
  if A <= X:
    count += 1
print(count)
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)
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]
cnt = 0
for i in range(N+1):
    if D[i]<=X:
        cnt+=1
print(cnt)
n, x = map(int, input().split())
L = list(map(int, input().split()))

reach = 0
for i, v in enumerate(L):
  reach += v
  if reach > x:
    print(i + 1)
    exit()
print(n + 1)
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()
N, X = map(int, input().split())
L = list(map(int, input().split()))

p = 0
i = 0
ans = 1

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


print(ans)
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)
N,X=map(int,input().split())
L=list(map(int,input().split()))
ans=0
d=0
if d<=X:
  ans+=1
for x in range(N):
  d=d+L[x]
  if d<=X:
    ans+=1
print(ans)
N, X = map(int, input().split())
L = list(map(int, input().split()))

t = 0
cnt = 1

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

for i in L:
  if p + i <= X:
    count += 1
    p += i
  else:
    break
    
print(count)
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)
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
A = 0
if D <= X:
    A += 1
for i in L:
    D += i
    if D <= X:
        A += 1
print(A)
f=lambda:map(int,input().split())
_,x=f();c,d=1,0
for i in f():
  d+=i
  if d>x: break
  c+=1
print(c)
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]
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()))

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

ans = 0
for i in jump:
    if i <= X:
        ans += 1
print(ans)
N,X=map(int, input().split())
L=list(map(int, input().split()))
ans=1
now=0
for l in L:
    now+=l
    if now<=X:
        ans+=1
print(ans)
n,x = map(int, input().split())
L = list(map(int, input().split()))
l = [0] * (n+1)
for i in range(1,n+1):
    l[i] = l[i-1] + L[i-1]
ans = 0
for a in l:
    if a <= x: ans += 1
print(ans)
import bisect as bi
I=lambda:list(map(int,input().split()))
n,x=I()
l=I()
ans=0
t=0
for i in range(1,n):
  l[i]+=l[i-1]
an=bi.bisect(l,x)
print(an+1)
# import itertools
# import math


def solve(N, X, L):
    ans = 1
    now = 0
    for ll in L:
        now += ll
        if now <= X:
            ans += 1
    return ans


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

# P = []
# S = []
# for i in range(N):
#     pp, ss  = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N, X, L))
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)
N, X = map(int, input().split())
L = list(map(int, input().split()))

ans = 1
bound = 0

for l in L:
    bound += l
    if bound > X:
        break
    ans += 1

print(ans)
n, x = map(int, input().split())
L = list(map(int, input().split()))
count = 0
sum = 0
for i in L:
    sum += i
    if sum <= x:
        count += 1
    else:
        continue
print(count+1)
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)
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)
N,X=map(int, input().split())
L=list(map(int, input().split()))
L.append(0)


d = 0
count = 0

#跳ねる直前からスタート

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

print(count)
N, X = map(int, input().split())
Ls = list(map(int, input().split()))
D = 0
ans = 1

for L in Ls:
    D += L
    if D > X:
        break
    ans += 1

print(ans)
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, X = lr()
L = lr()
cnt = 1
cur = 0
for l in L:   
    cur += l
    if cur > X:
        break
    cnt += 1

answer = cnt
print(answer)
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):
    d +=l[i]
    if d<=x:
        count+=1
print(count+1)
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,x = iim()
L = iil()
ans = 1
dis = 0
for item in L:
    dis += item
    if dis <= x:
        ans += 1
    else:
        break
print(ans)
n, x = map(int, input().split())
l = list(map(int, input().split()))
bound = [0]
for i in range(n):
    bound.append(bound[i]+l[i])
ans = sum(i<=x for i in bound)
print(ans)
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)
n,x=map(int,input().split())
arr=list(map(int,input().split()))
d=0
ans=1
for a in arr:
  d+=a
  if d <= x:
    ans+=1
print(ans)
n,x = map(int,input().split())
l = list(map(int,input().split()))
s = 1
c = 0
for i in range(n):
    c += l[i]
    if x >= c:
        s += 1
    else:
        break
print(s)
N, X = list(map(int, input().split()))
L = list(map(int, input().split()))

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

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

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

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


def cumsum(xs):
    result = [xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result


count = 1
cs = cumsum(L)
for i in cs:
    if X >= i:
        count += 1
print(count)
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:
        break

    ans += 1

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

d = [0]*(n+1)
for i in range(1,n+1):
  d[i] = d[i-1]+l[i-1]
  
d = sorted(d)
count = 0
for i in range(n+1):
  if d[i]>x:
    break
  count += 1
  
print(count)
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)
import bisect
N,X = map(int,input().split())
L =list(map(int,input().split()))
cnt = 0
M = [0]
for i in range(N):
    cnt += L[i]
    M.append(cnt)

print(bisect.bisect_right(M,X))
# coding: utf-8

from functools import reduce

def solve(X, Ls):
  return len(list(filter(
    lambda x: x <= X, reduce(lambda x, y: x + [x[-1] + y], Ls, [0]))))


if __name__ == '__main__':
  _, X = map(int, input().split())
  print(solve(X, map(int, input().split())))
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
        else:
            break
    print(ans)


if __name__ == '__main__':
    main()
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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


if __name__ == '__main__':
    main()
def main():
    N, X = map(int, input().split())
    L = [int(a) for a in input().split()]
    bound = 1
    D = 0
    for i in range(N):
        b = D + L[i]
        if b <= X:
            bound += 1
        D = b
    print(bound)
main()
n,x=map(int,input().split())

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

print(ans)
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)
N,X=map(int,input().split())
L = list(map(int,input().split()))
zahyo = 0
ans = 1
for i in range(len(L)):
    zahyo +=L[i]
    if X>=zahyo:
        ans += 1
print(ans)
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)
n,x = map(int, raw_input().split(' '))
ais = map(int, raw_input().split(' '))
count,cur,i = 0,0, 0
res = [cur]
while(i < len(ais)):
	cur += ais[i]
	res.append(cur)
	i +=1

print len([e for e in res if e <= x])
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)
N, X = map(int, input().split())
L = list(map(int, input().split())) 
D = 0
cnt = 1
for l in L:
    D += l
    if D > X:
        break
    else:
        cnt += 1
print(cnt)
n,x=map(int,input().split())
l=[int(i) for i in input().split()]
d=0
ans=n
for i in range(n):
    d=d+l[i]
    if d>x:
        ans=i
        break
print(ans+1)
N,X = map(int,input().split())
L = list(map(int,input().split()))
sum_list = [sum(L[:i]) for i in range(N+1)] 
count = 0
for i in sum_list:
    if i <= X:
        count +=1
print(count)
import sys
from sys import stdin

n, x = map(int, stdin.readline().split())
count = 1
num = 0
num_list = [0]

l = list(map(int, stdin.readline().split()))

for i in l:
  num += i
  num_list.append(num)
  if(num > x):
    print(count)
    sys.exit()
  else:
    count += 1 

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

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

main()
n, x = map(int, input().split())
a = [0] + list(map(int, input().split()))
ans = 0
for i in range(n):
    a[i + 1] += a[i]
for i in range(n + 1):
    if a[i] <= x:
        ans += 1
print(ans)
#!/usr/bin/env python3
n, x, *l = map(int, open(0).read().split())
a = n+1
i=sum(l)
while a > 1 and i>x:
    a -= 1
    i-=l[a-1]
print(a)
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(x >= d):
        cnt += 1
    else:
        break
            
print(cnt)
N,X = map(int,input().split())
L = list(map(int,input().split()))

D = []
D.append(0)

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

cnt = 0
for d in D:
  if d <= X:
    cnt += 1
    
print(cnt)
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+1)
def main():
    n, x = map(int, input().split())
    l_lst = list(map(int, input().split()))
    count = 0
    coordinate_lst = [0]

    for i in range(n):
        coordinate_lst.append(coordinate_lst[i] + l_lst[i])

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

    print(count)


if __name__ == '__main__':
    main()
#!/usr/bin/env python3

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

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

    cnt = 0
    for i in range(len(D)):
        if D[i] <= X:
            cnt += 1
    print(cnt)


main()
n,x=map(int,input().split())
a=list(map(int,input().split()))
sum=0
ans=1
for i in range(n) :
    sum+=a[i]
    if sum <= x :
        ans+=1
print(ans)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc130_b

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

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

print(i+1)
import bisect

N, X = map(int, input().split())
L = list(map(int, input().split()))
DP = [0] * (N+2)
for i in range(2, N+2):
    DP[i] = DP[i-1] + L[i-2]

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

print(cnt+1)
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
else:
    print(ans)
n,x = map(int,input().split())
l = [int(s) for s in input().split()]
ans = 1
height = 0
for i in range(n):
    height += l[i] 
    if height <= x:
        ans += 1
print(ans)
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:
        print(cnt)
        exit()
    cnt += 1
print(n + 1)
N,X = map(int, input().split())
L = list(map(int, input().split()))
p=0
c=1
for l in L:
  p+=l
  if p <= X:
    c+=1
  else:
    break
print(c)
n,x = map(int,input().split())
l = list(map(int,input().split()))
wa = 0
d = [0]*(n+3)
d[1]=0
d.pop(0)
wa = 1
for i in range(2,n+2):
  d[i]=d[i-1]+l[i-2]
  if(d[i]>x):
    break
  wa+=1
print(wa)
N, X = map(int, input().split())
L = list(map(int, input().split()))
ans = 1
pd = 0
for l in L:
    d = pd + l
    pd = d
    if d <= X:
        ans += 1
    else:
        break
print(ans)
# -*- coding: utf-8 -*-

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

d = 0
ans = 1

for l in ll:
    d += l

    if d > x:
        break


    ans += 1

print(ans)
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
print(n+1)
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)
import sys

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

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

print(res)
n,x = map(int,input().split())
L = list(map(int,input().split()))
D = 0
c = 0

for i in range(n):
	if D <= x:
		c += 1
	D += L[i]
if D <= x:
	print(c+1)
else:
	print(c)
LI = lambda: list(map(int, input().split()))

N, X = LI()
L = LI()


def main():
    ans = 1
    d = 0
    for l in L:
        d += l
        if d > X:
            break
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()
n, x = map(int, input().split())
l = list(map(int, input().split()))

ans = 0
bound = 0
for i in l:
    bound += i
    ans += 1
    if bound > x:
        break
else:
    ans = n + 1

print(ans)
n, x = [int(_) for _ in input().split()]
L = [int(_) for _ in input().split()]
res = 1
d = 0
for l in L:
  d += l
  res += (d <= x)
print(res)
n,x = map(int,input().split())
l_list = list(map(int,input().split()))
total = 0
ans = 0
#print(l_list)
for i in range(n):
    if total <= x:
        ans += 1
    else:
        break
    total += l_list[i]
if total <=x:
    ans += 1
print(ans)
from itertools import accumulate
from bisect import *
N, X = map(int, input().split())
L = list(tuple(map(int, input().split())))

acc = sorted(list(accumulate(L)) + [0])

n = bisect_right(acc,X)
print(n)
N,X = map(int,input().split())
L = list(map(int,input().split()))
b = 0
ans = 1
for i in range(N):
  b += L[i]
  if b <= X:
    ans += 1
  else:
    break
print(ans)
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m = inpl()
a = [0] + inpl()
acc = itertools.accumulate(a)
res = 0
for i in acc:
    if i <= m:
        res += 1
print(res)
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)
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0]*(n+1)
counter = 1
for i in range(1,n + 1):
    d[i] = d[i - 1] + l[i - 1]
    if d[i] <= x:
        counter += 1
print(counter)
#import sys
#import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
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)
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)
n, x = map(int,input().split())
l = list(map(int,input().split()))
d = [0] * (n + 1)
for i in range(1,n+1):
    d[i] = d[i-1]  + l[i-1]
ans = sum(d[i] <= x for i in range(n+1))
print(ans)
n,x=map(int,input().split())
l=list(map(int,input().split()))

zahyou=[0]
for i in range(n):
    zahyou.append(zahyou[i]+l[i])
for i in range(len(zahyou)):
    if zahyou[i]>x:
        del zahyou[i:n+1]
        break
print(len(zahyou))
n = list(map(int, input().split()))
m = list(map(int, input().split()))

ans = 0
new_list = [0]
for i in range(n[0]):
  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()))

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

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

plot=0
cnt=1

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

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

import numpy as np

arr = [0]

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


arr = np.array(arr)

ans = len(arr[arr<=X])

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

for i in range(n):
    total += a[i]
    if total <= x:
        cnt += 1
print(cnt)
N,X=map(int,input().split())
L=list(map(int,input().split()))
l=0
cnt=1
for i in range(N):
    l+=L[i]
    if l<=X: cnt+=1
    else: break
print(cnt)
N, X = map(int, input().split())
L = list(map(int, input().split()))
pos = 0
for i, l in enumerate(L, 1):
    pos += l
    if pos > X:
        print(i)
        break
else:
    print(N + 1)
N, X = map(int, input().split())
Llist = [int(i) for i in input().split()] 
Dlist = []

for i in range(N+1):
  if i == 0:
    Dlist.append(0)
  else:
    Dlist.append(Dlist[i-1]+Llist[i-1])


print(len([i for i in Dlist if i <= X]))
n,x = map(int,input().split())
a = list(map(int,input().split()))
c = 1
b = 0
for i in a:
    b = i+b
    if b <= x:
        c+=1
print(c)