@rishup_nitdgp the solutions of the setter, tester and editorialist are not visible. Please update the editorial with the solutions.
@rishup_nitdgp can you please check my code and tell which test case my code failing i used dp…but for 15 its failing for 1 test case and for 25 its failing one test case i have to merge my 15 points code with this to get those points but why this code failing link of solution CodeChef: Practical coding for everyone
That’s odd.
Your code (as well as @pict_tourist) gets exactly 1 test case wrong, printing 9277379 instead of 9277373).
I haven’t looked at your code tho, so I’m not sure of the cause.
Can you please share your code?
One way of story-telling 
https://www.codechef.com/viewsolution/36859863
Can anyone please explain why this code is getting TLE in case 4 and 6.
As the complexity is O(N*K) it shouldn’t get TLE.
Isn’t that irritating to debug.
Well, I see that sorting isn’t the problem. Your complexity is O(N×K×T). If you put the maximum values, it is around 9×107 which is close to 1 second time limit. If the constant factors are large then it might be the cause of TLE.
Even my code was failing at the same case, Please try to inform us of the mistake
Beautiful Problem !!
Probably he did it with some script.
Hah Very Smart of you
You are not alone, tried both tabular and recursive and failed in same test case, still trying to figure out.
Tabular Approach : CodeChef: Practical coding for everyone
Recursive with memoization : CodeChef: Practical coding for everyone.
Edit:
Memoization solution with proper comments:
CodeChef: Practical coding for everyone
@infinitepro please look into this why many have got wrong answer for just one test case.
Hey Risabh this is not related to editorial . But can you please tell me how is nit dgp for MTech CSE ?
Here’s my solution - CodeChef: Practical coding for everyone.
I don’t see how the time limit was tight. Knapsack DP is fairly straightforward.
Shouldn’t the second and third subtask be cleared with just a Normal Knapsack solution, where we can assign values to the lines based on their count. Like if there are 3 lines of color 1, I can assign them values 1,2,3. I did this but somehow the code failed for 3rd subtask.
https://www.codechef.com/viewsolution/36827810
Can you look into it? @infinitepro