Company: Ethos_2march
Difficulty: medium
Offloading Tasks Problem Description There are n servers. The workload of the i -th server is serverLoad[i] ( 0 <= i < n ). Every server must eventually be offloaded, and there are two ways to offload servers: Manual offload. You pick any single remaining server and offload it. You may do this for at most k servers in total. Any server may be chosen, whatever its workload. (inferred - the source limits only the number of manual offloads; its Example 1 manually offloads the servers with workloads 6 and 12, which are not the two smallest.) Server load management tool. One operation of the tool works as follows: It finds L , the highest workload among the servers that are still remaining. It offloads every remaining server whose workload is strictly greater than L / 2 . Using the tool is expensive. Find the minimum number of tool operations needed so that every server ends up offloaded, when at most k servers are offloaded manually. The order in which tool operations and manual offl