Company: Amazon_24sep
Difficulty: medium
Maximize Storage Efficiency Problem Description You are managing Amazon's cloud storage system. There are n tasks that need to be processed, and the i -th task is broken into num_segments[i] segments. The cloud storage is divided into m storage units. The segments are allocated to these units with the following rules: Each segment is stored in exactly one storage unit. Each storage unit must hold at least one segment. A storage unit cannot contain segments from more than one task. The segments of one task may be spread over several storage units. The storage efficiency of an allocation is the minimum number of segments that any storage unit contains. Organize the segments so that the storage efficiency is maximized , and report that maximum. Complete the function getMaximumStorageEfficiency(num_segments, m) , which returns the maximum storage efficiency. Input Format Read from standard input. n num_segments[0] num_segments[1] ... num_segments[n-1] m Line 1 contains the integer n , the