Modular exponentiation

one test case failed only here is link of code and tell me where i wrong

There’s a property of the modular operator, use that property and your code will work fine.
The property is (a*b)%c = ((a%c)*(b%c))%c.
Hope this helps.

i implement this my code 1 test case false and 8 testcase right https://ide.codingblocks.com/s/148733 this is link of code tell me where i wrong

Now your code is perfectly fine, just use long long instead of int because some large inputs are also being passed and your every case will get accepted.

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.