Test case 6 is failing. Rest all are working fine. Please do check
One test case getting wronged
Hi @zenolusx2, pls try to the use the property of mod here which states:
(a*b)%c = (a%c * b%c)%c
Hope this helps 
I have used that property… Only i have pre-calculated the value of a%c initially so that i don’t have to repeat it
why does it still get one test case wrong?
i just downloaded the test cases to see what output my code was giving. turns out my code was right from the start. however for some reason, test case 6 shows wrong answer even if it is actually correct
No No No @zenolusx2, nothing like that. You haven’t applied the property correctly; maybe. Try to print what all what values a and temp take after each iteration. You might notice your mistake. Also see how many times is the multiplication is actually taking place in your code. Check the header of the loop.
Sorry, @proRram am, I am unable to understand what I am supposed to do. Please do help me out. I tried printing values of a and temp after each iteration, and it shows up correctly. I have tried checking how many times the multiplication is taking place, and it is as it needs to be. Also, I have rechecked the modular property. And, I have tried the test case that was failing and it gives the correct output.
For the input
56789 3452 100000
my code’s output is 57521. and that is the given output in the testcases file.
Hi @zenolusx2, you are almost done. Just one thing is left. See what happens when b is 1. Then acc to ques, a%c should be printed. See what u are printing. It’s a really small thing.
I hope you’ll get it now. 
damn, i thought of everything else except for this. thank you…