AmazonOA #73
Min Operations (Bring Price Range Below d)
估计困难评测数据准备中,可先阅读题面
Given prices[n], integers k and d. Each op picks two indices (x, y) and a p ≤ k, then prices[x] += p, prices[y] -= p. Make max - min < d with minimum ops.
Constraints
1 ≤ n ≤ 10⁵1 ≤ prices[i] ≤ 10⁹1 ≤ k ≤ 10⁹2 ≤ d ≤ 10⁹