Logic Error

Can someone please help me. I can’t figure out why my code is giving WA for second testcase.

link to my code: CodeChef: Practical coding for everyone.

First of all please change the topic. This is not a runtime error. It is a logic error in your code.
Secondly please try to debug (dry run) your code using these test cases.
5 5
5 2
7 3
7 4

1 Like

Thanks a lot @ryan_2004_code . Now I know why my solution does not work. :smiley:

Your welcome :+1: