peterverebics/CodeNet_Python_118 huggingface dataset:
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    lsum = [0 for _ in range(N + 1)]
    for i in range(N):
        lsum[i + 1] = L[i] + lsum[i]

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


if __name__ == '__main__':
    solve()
n, x = map(int,input().split())
l = list(map(int,input().split()))
i, d =  0, 0
while i<n and d <= x:
    d += l[i]
    i += 1
if d == x and i == n:
    print(min(i+1,n))
else:
    print(min(i,n))
n,x = map(int, raw_input().split(' '))
ais = map(int, raw_input().split(' '))
count,cur,i = 0,0, 0
while(cur <= x and i < len(ais)):
  count +=1
  cur += ais[i]
  i +=1
print count
n, x = map(int, input().split())
l = list(map(int, input().split()))

a = 0
count = 0
for i in l:
    if a <= x:
        a += i
        count += 1
print(count)
n,x = map(int,input().split())
l_list = list(map(int,input().split()))
total = 0
ans = 0
for i in range(n):
    if total <= x:
        ans += 1
    else:
        break
    total += l_list[i]
print(ans)
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=count=0
for i in li0:
  if count<=l:
    count+=i
    ans+=1
  else:
    break
print(ans)
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=int(0)
count=int(1)
for i in range(N-1):
  D+=L[i]
  if D<=X:
    count+=1
  else:
    break
print(count)
n,x = map(int,input().split())
L = list(map(int,input().split()))

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

a = [0]

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

#print(a)

for j in range(len(a)):
    if a[j] <= x:
        pass
    else:
        print(j)
        break
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 in range(n):
    if i + l[i] <= x:
        cnt +=1
print(cnt)
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
a = 0
b = 0
for i in range(n):
  b += 1
  if a > x:
    break
  a += l[i]
    
print(b)
def intMap(): return map(int,input().split())
def intList(): return list(map(int, input().split()))

n,x = intMap()
l = intList()

d = 0
i = 0

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

# ans = min(i,n)
print(i)
n, x = map(int, input().split())
l = list(map(int, input().split()))
result = 0
res = 0
for i in l:
    res+=1
    result += i
    if(result > x):
        break
    
    
print(res)
n, x= input().split()
n, x= int(n), int(x)
lista=[]
sum=0

for x in input().split():
	x= int(x)
	lista.append(x)

cont=1
for i in range(n):
	sum+=lista[i]
	if sum <= x:
		cont+=1
print(cont)
n,x=map(int,input().split())
Y = list(map(int,input().split()))
Z = [0]*n
a = 0
for i in range(n):
  a +=Y[i]
  Z[i]=a
import bisect
print(1+bisect.bisect_left(Z,x))
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(min(i + 1, n))
        exit()
print(n)
n, x = list(map(int, input().split()))
l = list(map(int, input().split()))
d = 0
ans = 1

for num in range(n) :
    d = d + l[num]
    if d <= x:
        ans += 1
    else:
        print(ans)
        break
def next_pos(D,L):
    return D+L
    
N, X = map(int,input().split(" "))
L = [int(i) for i in input().split(" ")]
D = 0
count = 0

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

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

total = 0
ans = 0
for i in range( len( l )):
  total += l[ i ]
  if total > x:
    ans = i
    break
print( i + 1 )
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()))
k=0
cnt=0
for i in range(n):
    k += l[i]
    if k>x:
        print(i+1)
        exit()
    else:
        cnt += 1
        continue
print(cnt)
n,x = map(int, input().split())
l = tuple(map(int, input().split()))

d = []
for i in range(n):
    if i == 0: d.append(0)
    else:
        di = d[i-1] + l[i-1]
        d.append(di)
        
print(len([i for i in d if i <= x]))
import math
import string


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


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


n, x = map(int, input().split())
l = list(map(int, input().split()))
# print(l)
ll = [0]
sum = 0
for i in range(n):
    sum += l[i]
    ll.append(sum)
# print(ll)

cnt = 0
for i in range(n):
    if ll[i] <= x:
        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)
N, X = [int(s) for s in input().split(' ')]
Ls = [int(s) for s in input().split(' ')]
suma = [0]
for L in Ls:
    suma.append(suma[-1] + L)
    if suma[-1] > X:
        break
print(len(suma) - 1)
n, x = map(int, input().split())
l = list(map(int, input().split()))

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

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

D = 0
count = 0
for L in L_list:
    if D <= X:
        count += 1
    else:
        break
    D += L
print(count)
n,k=map(int,input().split())
s=0
l=list(map(int,input().split()))
c=0
i=0
while(s<=k and i<n):
    s+=l[i]
    i+=1
    c+=1
print(c)
n, x = map(int,input().split())
l = list(map(int,input().split()))
i, d = 0, 0
while i<n and d <= x:
    d += l[i]
    i += 1
print(i)
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = 0
for i in range(n):
    if d > x:
        print(i)
        exit(0)
    d += l[i]
print(n)
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
#ABC130 B

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)
inputted = list(map(int, input().split()))
N = inputted[0]
X = inputted[1]
L = list(map(int, input().split()))

x = 0
number_of_bounds = 0
for _i, Li in enumerate(L):
    x += Li
    number_of_bounds = _i + 1
    if x > X: break
    
print(number_of_bounds)
n,x=[int(x) for x in input().split()]
l=[int(x) for x in input().split()]
d=0
cnt=0
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()))
cnt = 1
d = 0
for i in range(n):
    d += l[i]
    if d == x:
        cnt += 1
        break
    elif d > x:
        break

print(cnt)
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
count = 0
for i in range(1,N+1):
  if D>X:
    break
  else:
    D+=L[i-1]
  count+=1
print(count)
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = list()
D.append(0)
count = 1
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()))

cnt = 1
D_a = 0
D_b = 0
for i in range(N):
    D_a = D_b + L[i]
    D_b = D_a
    if D_a > X:
        print(cnt)
    else:
        cnt += 1
n, x = map(int, input().split())
data = [0] + list(map(int, input().split()))
count = 0
tmp = 0
for d in data:
    tmp += d
    if tmp < x:
        count += 1
    # print(tmp)

print(count)
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
def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    sum = 0
    for idx, i in enumerate(l):
        sum += i
        if sum > x:
            print(idx + 1)
            break

if __name__ == '__main__':
    main()
def calcBoundCount(rangex, lstL):
    d = 0
    for i in range(0, len(lstL)):
        d = d + lstL[i]
        if rangex < d:
            return i + 1
    return len(lstL)

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

count = calcBoundCount(X, lstL)
print((count if count <= N+1 else N+1))
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n, x = map(int, input().split())
    l = tuple(map(int, input().split()))

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

if __name__ == '__main__':
    main()
n,x = map(int,input().split())
l = list(map(int,input().split()))
count = 1
x1 = 0
for i in range(n):
  if x1 + l[i] <= x:
    count += 1
    x1 += l[i]
  else:
    print(count)
    exit()
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
line = input()
num = (int)(line.split(" ")[0])
limit = (int)(line.split(" ")[1])

x = 0
count = 0
line = input()
for i in range(num):
  if x > limit:
    break
  x += (int)(line.split(" ")[i])
  count += 1
print(count)
def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    D = 0

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

    print(cnt)


if __name__ == "__main__":
    main()
N, X = map(int, input().split())
L = list(map(int, input().split()))

d = 0
c = 0
while d <= X:
    c += 1
    d += L[c-1]
    if c >= N:
        break
print(c)
n,x=map(int,input().split())
l=list(map(int,input().split()))
k=0
cnt=0
for i in range(n):
    k += l[i]
    cnt += 1
    if k>x:
        print(cnt+1)
        exit()
    else:
        continue
print(cnt+1)
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n, x = LI()
l = LI()
cnt = 1
d = 0
for i in range(n):
    if d + l[i] <= x:
        cnt += 1
        d += l[i]
print(cnt)
k, n = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
ct = 0
ans = 1
i = 0
while ct <= n:
  ct += l[i]
  ans += (ct <= n)
print(ans)
n,x = map(int, input().split())
L = list(map(int, input().split()))

H = 0
count = 0
for i in range(n):
  if H > x:
    print(count)
    exit()
  else:
    H += L[i]
    count += 1
  
print(n+1)
import itertools
import bisect

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

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

print(bisect.bisect_right(ll, x))
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]
if d[1]>x:
    print(0)
    exit()
for i in range(len(d)):
    if d[i]>x:
        print(i)
        exit()
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


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

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

print(ans)
import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n,x = IL()
    l = list(IL())
    ans = 0
    cur = 0
    for rep in l:
        ans += 1
        cur += rep
        if x < cur: break
    print(ans)
    return

if __name__=='__main__':
    Main()
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d = 0
count = 0
for li in l:
    if d <= x:
        count += 1
    d += li
print(count)
n,x=map(int,input().split())
l=list(map(int,input().split()))
cnt=0
d=[0 for _ in range(n+1)]
d[0]=0
for i in range(1,n+1):
    d[i]=d[i-1]+l[i-1]
    if d[i]<=x:
        cnt+=1
print(cnt)
n,x=map(int,input().split())
l=list(map(int,input().split()))
fly=0
for i in range(100):
  fly+=l[i]
  if fly>x:
    print(i+1)
    exit()
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = list()
D.append(0)
count = 1
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:
        count+=0
print(count)
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()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist >= x:
        print(i)
        exit()
n, x = map(int, input().split())
l = list(map(int, input().split()))

cnt = 1
d = 0

for i in range(1, n):
    d = d + l[i-1]
    if(x - d >= 0):
        cnt += 1
print(cnt)
n,x = map(int,input().split())
a = list(map(int,input().split()))
c = 0
b = 0
for i in a:
    b = i+b
    if b <= x:
        c+=1
print(c)
n,x=map(int, input().split())
l=list(map(int,input().split()))
cnt=0
zahyou=0
for i in range(n):
  while zahyou<=x:
    cnt+=1
    zahyou+=l[i]
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:
        break
    total_length = total_length + length[i]
    count = count + 1

count = count - 1

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

if __name__ == '__main__':
    main()
#ABC130 B

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

print(count + 1)
N,X=map(int,input().split())
L=list(map(int,input().split()))
Y=[]
D=0
e=0
for i in range(1,N+1):
    while D<=X:
        D=D+L[i]
        e+=1
print(e)
n,x = map(int,input().split())
l_lst = list(map(int,input().split()))
b = 0
sum_l = 0
for l in l_lst:
  if sum_l > x:
    break
  sum_l += l
  b+=1

print(b)
N,X=map(int,input().split())
L=list(map(int,input().split()))
mem=0; ans=0
for i in L:
    if mem>X: break 
    ans+=1
    mem+=i
print(ans)
import sys
N, X = map(int, input().split())
l = list(map(int, input().split()))
val, count = 0, 1
for i in l:
    val += i
    if val <= X:
        count += 1
    else:
        print(count)
        sys.exit()
n,x = map(int,input().split())
l = [int(x) for x in input().split()]

save = 1
for i in range(1,n+1):
    if(i==1):
        d = 0
        continue
    d = d + l[i-2]
    if(d > x):
        break
    save = i
    
print(save)
from sys import stdin

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

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

for i in l:
  num += i
  if(num > x):
    print(count)
    break
  else:
    count += 1
n,x=map(int,input().split())
li=list(map(int,input().split()))
ans=1
l=0
for i in li:
  l+=i
  if l>x:
    print(ans)
    break
  ans+=1
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0] * (n+2)
count = 1
for i in range(1, n, 1):
    d[i] = d[i-1] + l[i-1]
    if d[i] <= x:
        count += 1
print(count)
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
c=1
for i in range (0,n-1):
  d=d+l[i]
  if d<=x:
    c+=1
print(c)
y = [int(z) for z in input().split()]
l = [int(z) for z in input().split()]
d = [0]*(y[0]+1)
for i in range(1,y[0]+1):
      d[i] = d[i-1]+l[i-1]
      if (d[i]>y[1]):
            break
print(i)
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
count = 0
for i in range(1,N+1):
  if D>=X:
    break
  else:
    count+=1
    D+=L[i-1]
print(count)
N,X = map(int, input().split())
l = list(map(int,input().split()))
count = 1
d = 0
for i in range(1,N):
  d = d + l[i]
  if d <= X:
    count += 1
print(count)
N,X = map(int,input().split())
Ls = list(map(int,input().split()))

D = 0
ans = 0

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

print(ans)
n,x=map(int,input().split())
s=list(map(int,input().split()))
t=sum(s)
b,c=0,0
while b<=x and len(s)>0:
    c+=1
    b+=s[0]
    del s[0]
if t==b:
    print(n+1)
else:
    print(c)
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
a=0
for i in range(n-1):
    a+=1
    i+=1
    d+=l[i]
    if d>x:
        break
if d==x:
    a+=1
    
print(a)
n,x = map(int,raw_input().split())
l = map(int,raw_input().split())
d1=0
bou = 1
for i in xrange(1,n):
    di = d1 + l[i-1]
    d1 = di
     
    if di > x:
        break
    else:
        bou += 1
print bou
n, x = map(int, input().split())
a = list(map(int, input().split()))
s = 0
t = 0
for i in range(n):
  s = s + a[i]
  if s <= x:
    t += 1
print(t)
N, X = map(int, input().split(' '))
L_ls = map(int, input().split(' '))
D, cnt = 0, 0
for L in L_ls:
    cnt += 1
    D += L
    if D > X:
        break
print(cnt)
def main():
  n, x, *ls = map(int, open(0).read().split())
  d=0
  cou=1
  for l in ls:
    d += l
    if d <= x:
      cou+=1
    else:
      return(cou)
  return n
if __name__ == '__main__':
  print(main())
n, x = map(int, input().split())
L = list(map(int, input().split()))
val = 0
count = 0

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

for i in range(1, n+1):
    if d[i] <= x:
        continue
    else:
        print(i)
        exit()
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
print(cnt)
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
e = 1
for i in range(n):
  if d + l[i] <= x:
    e += 1
    d = d + l[i]
print(e)
def intMap(): return map(int,input().split())
def intList(): return list(map(int, input().split()))

n,x = intMap()
l = intList()

d = 0
i = 0

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

ans = min(i,n)
print(ans)
N, X = list(map(lambda a: int(a), input().split(" ")))
L = list(map(lambda b: int(b), input().split(" ")))

i = 1
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

print(i)
# coding = SJIS
n, x = map(int, input().split())
lis = list(map(int, input().split()))
ans = 1
now = 0

for i in range(n):
    if now + lis[i] <= x:
        ans += 1
        now += lis[i]
if ans > n:
    ans -= 1

print(ans)
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)
import bisect

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

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

res = bisect.bisect_right(sorted(d), x)
#print(len([i for i in d if i <= x]))
print(res)
a,b=map(int,input().split())
l=list(map(int,input().split()))
c=1
d=0
for i in range(a):
  d+=l[i]
  if d<=b:
    print(c)
    
    break
  c+=1
n, x = map(int, input().split())
l = list(map(int, input().split()))

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

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

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

ans = n
for i in range(n+1):
  if x < d[i]:
    ans = i
    break
    
print(ans)
def main():
    N, X = (int(x) for x in input().split())
    L = [int(x) for x in input().split()]
    D = [0]

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

    print(len(D))


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): 
	cnt+=1 
	sum_lst+=lst[i]
	if sum_lst>y: 
		print(cnt-1) 
		break
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):
    count += 1
    if i == 0: continue
    else:
        tmp += list_l[i - 1]
        if tmp > x:
            break
print(count - 1)
n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 1
point = 0

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

print(min(ans, n + 1))
import sys

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

for i in range(n):
    if sum(l_list[:i+1]) > x:
        print(i+1)
        sys.exit()
n,x = map(int,input().split())
listl = []
listl += map(int,input().split())
# print(listl)

cnt=0
d=0
# print(d)
while cnt<len(listl):
    if d > x:
        break
    d = d+listl[cnt]
    # print(d)
    cnt+=1

print(cnt)
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
a=0
for i in range(n-1):
    a+=1
    d+=l[i]
    #print(d)
    if d>x:
        break

if d==x:
    a+=1

print(a)
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(i + 1)
        exit()
print(n)
N, X = map(int, input().split())
L = list(map(int, input().split()))
z = 0
cnt = 0

while z<=X and cnt<len(L):
    z += L[cnt]
    cnt += 1

print(min(cnt, N+1))
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
    
    else:
        cnt -= 1
        print(cnt)
        exit()
    
print(cnt)
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
d = 0
for i in b:
  d += i
  c += 1
  if d > a[1]:
    print(c)
    break
N, X = map(int, input().split())
L = list(map(int, input().split()))

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

print(ans)