subset-sum problem

Whats wrong in my code ??
All my testcases are right but still its giving wrong answer.

Question link - https://www.codechef.com/problems/TF01
Solution link - https://www.codechef.com/viewsolution/14528198

This similar to famous Coin-Change problem . You can learn about this here

//