PRATA (Spoj) Problem

even for small values I am not getting correct answer

@vivekpatel Review your code I’m doing it too. Try debugging your code by printing.

1 Like

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.

@vivekpatel I have made small changes in your code, the upper limit should be highest_rank* ( no_of_roti * (no_of_roti + 1) ) /2 . Your code is working fine.
Edited Code