For each test case, choose integer shares of three juices summing to 10000 so that the most guests get at least their per-juice minimums.
Medium7GeometryImplementationBrute forceGreedyNo attempts yetTime limit5sMemory limit512 MBYou are throwing a party, and you mix three juices into one drink: apple, banana and carrot. Call them juice A, juice B and juice C.
You decide what share of the drink each juice takes. A share is an integer in parts per ten thousand, and the three shares add up to exactly 10000.
Each guest has a minimum share for every juice. A guest likes the drink only if the share of each of the three juices is at least that guest's minimum for that juice.
Choose the shares so that as many guests as possible like the drink, and report that number.
The first line contains an integer T, the number of test cases.
Each test case is given as follows.
Limits
Print one line per test case, in the order the test cases appear in the input, containing "Case #X: Y". X is the test case number starting from 1, and Y is the largest number of guests who like the drink.
In the first test case of the first example, each of the three guests wants the drink made from a single juice, and the three juices differ, so only one guest can be satisfied.
In the second test case, any two of the three guests can be satisfied together.
In the third test case, shares of 3334, 3333 and 3333 satisfy all five guests.