import sys
import array
input=sys.stdin.readline

n,x=0,0
nums=array.array('i', [])
num=0
while True:
    s=sys.stdin.buffer.read()
    if not s:break
    for b in s:
        if 48 <= b <= 57:
            num = num * 10 + (b - 48)
        else:
            if not n:
                n=num
                num=0
                continue
            if not x:
                x=num
                num=0
                continue
            nums.append(num)
            num=0

ans_l,ans_r=0,n
total=0
l=0
for r in range(n):
    total+=nums[r]

    while total-nums[l]>=x:
        total-=nums[l]
        l+=1

    if total>=x and ans_r-ans_l>r-l:
        ans_r=r
        ans_l=l

print(ans_l+1,ans_r+1)

滑动窗口,维护窗口内总和大小,但是需要注意使用list太大过不了,需要使用array