Make Power Non-decreasing
Suppose we, together, run a cloud computing company that offers a highly scalable system that allows applications to expand efficiently. We now have a set of n servers that are used to horizontally scale an application.
The objective is to ensure that the computational power of these servers is arranged in a non-decreasing order.
To achieve this, we are allowed to increment the computational power of any contiguous segment of servers by a chosen value z. The challenge is to determine the optimal values of z for different segments so that, once the computational powers are in the desired non-decreasing order, the total sum of all chosen z values across the entire process is minimized.
1Example 1

2Example 2
3Example 3
Constraints
Limits and guarantees your solution can rely on.