Given $$$n$$$ elements $$$a_i$$$
Each operation can increase or decrease an element by one unit.
Ask for the minimum number of operations so that two consecutive elements have a difference less than $$$k$$$.
Let $$$n \le 100; \;a_i, k \le 10^9$$$
This problem cannot be dp ?
Given $$$n$$$ elements $$$a_i$$$
Each operation can increase or decrease an element by one unit.
Ask for the minimum number of operations so that two consecutive elements have a difference less than $$$k$$$.
Let $$$n \le 100; \;a_i, k \le 10^9$$$