Almost Increasing Array
Execution time limit is 3 seconds
Runtime memory usage limit is 512 megabytes
We call an array almost increasing if we can erase not more than one element from it so that the array becomes strictly increasing (that is, every element is striclty greater than every element before it).
You are given an array consisting of elements. You are allowed to replace any element with any integer number (and you may do so any number of times you need). What is the minimum number of replacements you must perform to make the array almost increasing?
Input
The first line contains one integer — the number of elements in .
The second line contains integers — the array .
Output
Print the minimum number of replaces you must perform so that is almost increasing.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 210
Acceptance rate 1%