
The first line contains an integer ‘T’, which denotes the number of test cases to be run. Then, the ‘T’ test cases follow.
The first line of each test case contains three positive integers, ‘A’, ‘B’, and ‘M’ respectively.
For each test case, print a single positive integer, the value of ‘A^B’ mod ‘M’.
The output of each test case will be printed in a separate line.
You do not need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= A <= 10^6
1 <= M <= 10^6
1 <= |B| <= 250
Where |B| is the number of digits of ‘B’ in base 3.
Time Limit: 1 sec
Pair Product Div by K
Pair Product Div by K
Merge Two Sorted Arrays Without Extra Space
Merge Two Sorted Arrays Without Extra Space
Co-Prime
First Digit One
Special Digit Numbers