HELP IN NOCHANGE please hepl me with the WA in this code

Your code is not satisfying the condition S-Di < p .
For example for input:
3 39
3 13 39

And your code output is
YES 12 1 0

Which leads to a total sum (S) greater than p but when we remove one coin of 3 from the total sum (S) it’s still greater than p which is wrong.

I think it will definitely help you!


thanks bhai

1 Like