Professional Documents
Culture Documents
Problem B
Segments
Time Limit: 1 second
Memory Limit: 256 megabytes
Input
The first line contains two positive integers 𝑛, 𝑚 (𝑛 ≤ 105 ; 𝑚 ≤ 109 ).
The second line contains 𝑛 integers 𝑎1 , 𝑎2 , … , 𝑎𝑛 (|𝑎𝑖 | ≤ 109 ; 𝑖 = 1,2, … , 𝑛)
Note: It is guaranteed that there always exists a split satisfying the condition.
Output
The output contains only one integer 𝑘 - the minimum number of segments you can split.