Krzysztof Duleba wrote:Why do you think that the problem is wrong? You just can't understand it and it's not the same.
Don't be so blunt, please. The problem description contains (at least) three stupid errors, which makes it quite hard to understand.
For examples, n=3, k=0, the apples are of weight 1, 2, 3, 4.
makes no sense; n should be 4.
If he eats apple #1, then he east total weight of 1, 3, 3, 3 when apple #1, #2, #3 and #4 are sweet respectively. This yields a solution of 1+3+3+3=13, beating 14.
The numbers are wrong and there is not enough explanation. It should read someting like: "If he eats apple #1 and then, if it's bitter, apple #3, the total weight is 1+4+4+4=13, beating 14."
The first line of input contains a single integer t(1<=t<=100), the number of test cases.
...
Sample Input
3
2 0
3 0
4 0
5 0
10 20
Sample Output
Case 1: 2
Case 2: 6
Case 3: 13
Case 4: 22
Case 5: 605
I guess you can spot the error.
Looks like the problemsetter was in great hurry to finish the description in time. He is a great problemsetter. I think his companion 'Elites' should have saved him for this blunders. (But who am I to judge. I never set a decent problem...)