I am getting a WA in spite of getting the right output

I am a newbie, can anyone please help me regarding this issue of getting a wrong answer though we get the correct output. Please!!!
The link to my solution follows
https://www.codechef.com/submit/CHFMOT18

Hi ,

Testcase :

1
25 6

Your output : 6
Correct output : 5

:slight_smile:

1 Like

when n < s and the remainder when s is divided by n is 1 then the value of your a should just be (s/n)+1 and not (s/n)+2. That’s the only issue I can see. Fix that and you are good to go.

1 Like

That was very much helpful.Thank you so much!!!

1 Like

Yeah I just corrected it.Thank you!

1 Like