#c221402. 区间取数2
区间取数2
Longest Subsegment with Sum at Most K
Problem Description
You are given numbers and an integer . You need to pick a contiguous segment from these numbers so that the sum of the chosen numbers does not exceed .
What is the maximum number of numbers you can pick?
Input Format
The first line contains two integers .
The next line contains integers .
Output Format
Output a single integer, the answer.
Sample Input
4 4
2 3 3 3
Sample Output
1
Constraints
For of the data: , , .