
1) It is guaranteed that the Kth digit from the right always exists.
2) It is also guaranteed that 'K' is always less than or equal to the number of digits in N ^ M.
3) 'N' and 'M 'can’t be a 0 simultaneously.
The first line contains an integer ‘T', which denotes the number of test cases or queries to be run. Then, the T test cases follow.
The first line of each test case contains three non-negative integers N, M, and K, as described in the problem statement.
For each test case, print in a new line, an integer denoting the Kth digit in N^M from the right.
The output for 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 <= 100
0 <= N <= 15
0 <= M <= 15
1 <= K <= Digits in N ^ M
Time Limit: 1sec.
The idea here is to use the pow function to find N raised to the power M. After finding the power, we start removing the digits from the last until we get the kth digit.
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