you are given an array **A** of $n$ positive integers ( $0<A[i]<10^9$ ) and $r$ moves.↵
↵
on each move:↵
you can choose any subarray of **A** (which contains only positive elements) and decrease all elements in that subarray by one.↵
↵
your task is to maximize the number of $0$ values in your array.↵
↵
print that number after $r$ moves.↵
↵
**input:**↵
↵
- $n,r$↵
↵
- $A[1],A[2],..A[n]$↵
↵
↵
**ouput:**↵
↵
- number of $0$ values after r moves↵
↵
**example input:**↵
↵
$6$ $2$↵
↵
$0$ $2$ $1$ $2$ $2$ $3$↵
↵
**output**↵
↵
$4$↵
↵
↵
↵
↵
- **subtask1:** $n<=10;r=1$↵
- **subtask2:** $n<=10;r<=5$↵
- **subtask23:** $n<=200;r<=200$↵
- **subtask24:** $n<=200;r<=10^9$↵
- **subtask25:** $n<=2000;r<=10^9$↵
↵
on each move:↵
you can choose any subarray of **A** (which contains only positive elements) and decrease all elements in that subarray by one.↵
↵
your task is to maximize the number of $0$ values in your array.↵
↵
print that number after $r$ moves.↵
↵
**input:**↵
↵
- $n,r$↵
↵
- $A[1],A[2],..A[n]$↵
↵
↵
**ouput:**↵
↵
- number of $0$ values after r moves↵
↵
**example input:**↵
↵
$6$ $2$↵
↵
$0$ $2$ $1$ $2$ $2$ $3$↵
↵
**output**↵
↵
$4$↵
↵
↵
↵
↵
- **subtask1:** $n<=10;r=1$↵
- **subtask2:** $n<=10;r<=5$↵
- **subtask
- **subtask
- **subtask