Under construction

Still being built. Things may change

Special Serving

Interview

Time limit1sMemory limit512 MB

Summary
Given N values x_i, find the fewest students to switch from pamuntwi to eggplant so the running sum never reaches M.
Level

Medium5 of 10

Topics
Greedy, Heap
Solved
No attempts yet

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!

NN students stand in a cafeteria line one after another. When the ii-th student from the front gets pamuntwi instead of eggplant, their dissatisfaction rises by xix_i. When they get eggplant, it drops by xix_i. The initial dissatisfaction is 00.

Food is served to students in order from the front. If the dissatisfaction ever reaches MM 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 NN and MM, separated by a space.

The second line contains NN integers xix_i, separated by spaces.

Output

On the first line, print the minimum number of eggplants needed to prevent the students from staging an eggplant movement.

Constraints

  • 1≤N≤200 0001 \leq N \leq 200\,000
  • 1≤M≤1091 \leq M \leq 10^9
  • 0≤xi≤1090 \leq x_i \leq 10^9

Examples2

  1. Example 1

    Input
    5 3
    0 0 2 0 2
    
    Expected output
    1
    
  2. Example 2

    Input
    10 90
    14 6 12 16 14 6 20 19 16 12
    
    Expected output
    2