Not running although logic seems correct to me

sol: https://ide.codingblocks.com/s/381331

prob: https://hack.codingblocks.com/app/contests/1975/1743/problem

Hey @raghav007 you have to make a loop to take t test case number, which you haven’t. Causing wrong output.


I fixed it only test cases are passing

Check your code in input
13 5, it should give 2, it’s giving 3
Consider side cases,
like if input is
13 7, then it should give 1 as answer as candies will be 14 and each friend can get 2 candies each.

Have debugged your code here


Now think for side case cause test case 0 & 1 are the side cases.

thanks a lot , but I don’t understand those side cases can you pls explain?

Build input format yourself and se where are you missing it. You will find that for sure :slightly_smiling_face:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.