In the ICPC World Cup cricket match, Bangladesh won the toss and chose to field first. To secure a victory, Bangladesh needs to strategically break the partnerships at crucial moments to minimize the total runs scored by opponent.
The strategy is as follows,
Hathurusingha provided a threshold to Bangladeshi bowlers, instructed them to take a wicket when the sum of runs scored in exactly two consecutive balls exceed the given threshold .
Now, you are provided with the total number of balls , played in the first innings, along with the runs scored in each ball. Your task is to calculate the number of wickets taken by Bangladesh team if they play strategically.
The first line contains two integers and — representing total number of balled played and threshold provided by Hathurusingha respectively.
The second line contains integers — representing the runs scored in each ball.
A single integer representing the number of wickets taken by Bangladesh team if they play strategically.
Input | Output |
---|---|
10 4 0 1 0 2 6 1 2 0 4 1 | 3 |