| ||We have R red, G green, and B blue balls.
We want to divide them into as few packages as possible.
Each package must contain 1, 2, or 3 balls.
Additionally, each package must be either a "normal set" (all balls in the package have the same color), or a "variety set" (no two balls have the same color).
Compute and return the smallest possible number of packages.|
|Parameters:||int, int, int|
|Method signature:||int minPacks(int R, int G, int B)|
|(be sure your method is public)|
|-||R, G, and B will each be between 1 and 100, inclusive.|
|We have 4 red, 2 green, and 4 blue balls.
Clearly, we need at least four packages to store 10 balls.
One possibility of using exactly four packages looks as follows: RGB, RG, RR, BBB.
(I.e., the first package has 1 ball of each color, the second package has a red and a green ball, and so on.)|
|Here the only possible solution is to have one package with RGB and two packages with GGG each.|
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.