Print the Kth Digit
Submissions: 13716   Accuracy:

48.5%

  Difficulty: Basic   Marks: 1

Given two numbers A and B, find Kth digit from right of AB.

Input:
The first line of the input contains T denoting the number of test cases. T testcases follow.  Each of the next T lines contains three space separated positive integers denoting the value of a , b and k respectively.

Output:
For each test case, in a new line, output the Kth digit from right of AB in new line.

Constraints:
1 <= T <= 100
1 <= A , B <=15
1 <= K <= |totaldigits in AB|

Example:
Input:
2
3 3 1
5 2 2

Output:
7
2

** For More Input/Output Examples Use 'Expected Output' option **

Author: dipjal1996


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.