Back to problems

Minimum Racks to Pack Machines with Two Resource Constraints

Algorithm · Google · Hard

Problem You receive N machines, where machine i requires two resources, represented by (x_i, y_i). Every rack provides capacities (a, b). The total x demand of all machines assigned to a rack must not exceed a, and their total y demand must not exceed b. Place each machine in one and only one rack. Since any number of racks may be used, determine the smallest number that can accommodate all machines. I/O (suggested) Input: An integer N, then N pairs (x_i, y_i), followed by…

Checking your access…