i don’t want you to reveal anything about the solution.

seeing the time limit on the question, i thought any naive approach would not be enough. By then, i start to think that this is the typical NP-hard problem.
So, is it that typical NP-hard problem i’m thinking about?? But how can a NP-hard problem can run in the given time limit for this question. And if you apply DP(though i have 2 WA already), how can it work for large sums for subtask #2? P.S. If answering this reveals the solution or any algorithm applied to do this problem, then don’t answer it.

As far as I know, yes It is NP-Hard Problem…
& yes It can be solved, although I’m also wondering how, but submission results have shown that It is possible…
So, keep trying… Sleep. Code. Eat. Repeat.

As the constraints are low, it is possible to solve this NP-hard problem.But as a matter of fact, the subtask #2 is high for consideration. And yes, it is that NP-hard problem

Weak test cases for SANSKAR… We can get AC by using two different approaches for two subtasks even if one out this solution will give WA if the test cases are improved…and the other will give TLE…