https://www.codechef.com/viewsolution/46653020

the logic i used is that ball jumps k steps ahead in forward direction and n+1-k steps in backward respectively but all my guessed test cases passed including question given test cases … help me out .

https://www.codechef.com/viewsolution/46653020

the logic i used is that ball jumps k steps ahead in forward direction and n+1-k steps in backward respectively but all my guessed test cases passed including question given test cases … help me out .

1 Like

if(x%k==0 || (n+1-x)%k==0)

cout<<“YES”<<endl;

else

cout<<“NO”<<endl;

It was a simple one… I hope now you’ll understand it your own

I tried your suggestions sir but it is not working out after submittion still… I am worried why my answer is not right…after all those test cases

I already understood this solution …sir