1876 最短子序列


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

给定长度为n的整数数列,A[0],A[1],A[2]….A[n-1]以及整数S,求出总和不小于S的连续子序列的长度的最小值。如果解不存在,则输出0。

Input

输入数据有多组,每组数据第一行输入n,S, (10<n<10^5,S<10^8)第二行输入A[0],A[1],A[2]….A[n-1] ( 0<A[i]≤10000),处理到文件结束。所有输入数据都在int范围之内。

Output

每组数据输出结果占一行。

Sample

Input

10 15
5 1 3 5 10 7 4 9 2 8

Output

2

Hint

在样本输入中,A[3]+A[4]=5+10=15≥15,所以输出2


Comments

There are no comments at the moment.