#Q183. 「一本通 5.5 练习 2」绿色通道

「一本通 5.5 练习 2」绿色通道

Description

The high school math assignment "Green Passage" consists of nn problems to copy complete, numbered 1n1\ldots n. Copying the ii-th problem takes aia_i minutes. Little Y has decided to spend no more than tt minutes on this task, so some problems will inevitably be left blank. Each problem must either be fully copied or left entirely blank—partial completion is not allowed. A sequence of consecutively numbered blank problems is called a blank segment, and its length is the number of problems it contains. Naturally, this approach will provoke Teacher Ma's anger, and the longer the longest blank segment, the angrier Teacher Ma will be. Now, Little Y wants to know which problems he should complete within the tt minutes to minimize Teacher Ma's anger. Since Little Y is very smart, you only need to tell him the minimum possible length of the longest blank segment; there's no need to output the specific selection of problems.

Input Format

The first line contains two integers, nn and tt. The second line contains nn integers, representing a1,a2,,ana_1, a_2, \dots, a_n in order.

Output Format

Output a single integer, indicating the minimum possible length of the longest blank segment.

Sample 1

a 6 4 5 2 5 3 4 5 2 3 4 5 2 3 6 3 5
Blank?
17 11
6 4 5 2 5 3 4 5 2 3 4 5 2 3 6 3 5

3

Constraints & Hints

For 60%60\% of the data, n2000n\le 2000; For all data, 0<n5×1040<n\le 5\times 10^4, 0<ai30000<a_i\le 3000, and 0<t1080<t\le 10^8.