Unable to pass all test cases

My code works fine and is producing correct output for my test case. However its still not passing some test case. Please help!

Hi! PLease help my code is working fine on my pc and giving right output but not compiling on this online compiler

when you have find that your strength is less than k at any point then you have to break you should not return in that case because if you will return then your code will not print ‘no’ for that answer. In fact there will be no output for that answer because you have then returned to the main from where you have called this function.
whereas if you will break it will break the loop only and then afterwards it will check for the if condition.
this is the error.
Happy Learning!!