Editorial for TLE '16 Contest 2 P2 - Packing Microwaves
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
We can brute force the different permutations of side lengths (there are only 6) of microwaves and check to see how many we can fit in the truck for each orientation. We can get the number of microwaves per dimension by dividing the dimension of the truck by the dimension of a microwave. Divide by the maximum number of microwaves that can be fit to get the answer, rounding up the answer if necessary. If the maximum number of microwaves that can be fit is , then print SCAMMED
. Keep in mind that 64-bit integers should be used to compute the solutions, as stated in the problem statement.
Time Complexity:
Comments