Piyush and magical park

out 5 test cases, 3 test cases passed but 2 are showing wrong answer. i cannot figure out the error in my code. i am attaching the ide link —>https://ide.codingblocks.com/s/164514

updated link —>https://ide.codingblocks.com/s/164516

sir! i figured out my error but it is still showing 2 test cases as wrong answer.

Pls wait,… i m checking your code…

i haven’t received any update regarding this problem.

I have edited your code, basically you havent included the condition when the value of s becomes less than k, then inside the loop you will break,…as you cannot calculate the strength further, I have made the changes in your code, kindly refer to them…

thanks ma’am it worked