MARBLES in Mathematics

My code got accepted in codechef but here only 1 test case is passing. Please resolve the issue.

Share your code so that i can have a look. Do check for modulo. Take it at every step. Probably you might be missing it somewhere.

Marbles code

The question however does not ask to do modulus.

Your code is generating correct outputs. But overflowing for inputs like 64 ,30.
759510004936100355 should be the answer but your code isn’t generating that. Its overflowing. You shall take care of that. Apart from that, the code is absolutely fine.

Will do it. Thanks a lot.

If you feel your doubt has been resolved, You may mark the doubt as resolved.
Please give a feedback. Your feedback is important :slight_smile: