Special Serving
InterviewTime limit1sMemory limit512 MB
Given N values x_i, find the fewest students to switch from pamuntwi to eggplant so the running sum never reaches M.
Problem
???: Eggplant? They don't even look alike...
NLCS Jeju likes to serve pamuntwi (fried beef breaded with Parmesan).
Students would rather eat fresh eggplant than pamuntwi!
students stand in a cafeteria line one after another. When the -th student from the front gets pamuntwi instead of eggplant, their dissatisfaction rises by . When they get eggplant, it drops by . The initial dissatisfaction is .
Food is served to students in order from the front. If the dissatisfaction ever reaches or more at any moment, the students stage an 'eggplant movement.'
Write a program that finds the minimum number of eggplants needed to prevent any eggplant movement.
Input
The first line contains and , separated by a space.
The second line contains integers , separated by spaces.
Output
On the first line, print the minimum number of eggplants needed to prevent the students from staging an eggplant movement.