Company: Teradata
Difficulty: medium
Maximize the Minimum City Power There are `n` cities in a line. `stations[i]` is the number of power stations in city `i`. Every station powers every city whose distance from it is at most `r`. You may build at most `k` additional stations in any cities. Determine the largest possible value of the minimum power among all cities. Input Format The first line contains `n`, `r`, and `k`. The second line contains `n` integers `stations[0], ..., stations[n-1]`. Output Format Print the maximum achievable minimum city power. Constraints `1 <= n <= 100000`, `0 <= stations[i] <= 100000`, `0 <= r < n`, and `0 <= k <= 10^9`. Notes A station built in city `i` powers every city `j` with `|i - j| <= r`. Several added stations may be built in the same city. Use 64-bit arithmetic. Example Input ```text 5 1 2 1 2 4 5 0 ``` Output ```text 5 ```