#c221402. 区间取数2

区间取数2

Longest Subsegment with Sum at Most K

Problem Description

You are given nn numbers a1,a2,…,ana_1, a_2, \dots, a_n and an integer kk. You need to pick a contiguous segment from these nn numbers so that the sum of the chosen numbers does not exceed kk.

What is the maximum number of numbers you can pick?

Input Format

The first line contains two integers n,kn, k.

The next line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n.

Output Format

Output a single integer, the answer.

Sample Input

4 4
2 3 3 3

Sample Output

1

Constraints

For 100%100\% of the data: 1≤n≤1061 \leq n \leq 10^6, 1≤k≤1091 \leq k \leq 10^9, 1≤ai≤1041 \leq a_i \leq 10^4.