HELP IN NOCHANGE

Ftlacv - Online C++ Compiler & Debugging Tool - Ideone.com please hepl me with the WA in this code

Your code is not satisfying the condition S-Di < p .
For example for input:
1
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!

2 Likes

thanks bhai

1 Like