Bosky often helps his younger brother Nitin with his home work and also clears his doubts.
Today, Nitin learned about proper fractions. He went a step forward and tried to represent the same proper fraction in its decimal form, but runs into problems. He now seeks help from his brother Bosky.
Nitin is a very sincere learner, thus he wants his brother to help him but doesn't want him to completely solve the problem. He goes to his brother Bosky and asks him to help him wherever he gets stuck while representing the proper fraction in decimal expansion by telling the next digit in the decimal expansion.
Though Bosky is a bit busy today with his school project, he doesn't want to disappoint his brother. He is familiar with your brilliant programming skills and asks you to create a program to help his brother, which can output R \(th\) digit in the decimal expansion for a given proper fraction \(\frac{N}{D}\).
Input:
Input will contain a number T denoting the number of test cases.
Then T test cases follow, each one consisting 3 integers N D R where N and D are numerator and denominator respectively.
Output
For each test case, output a single integer representing R \(th\) digit from the left in the decimal expansion.
NOTE: The number is a proper fraction, hence the counting will always start after the decimal place. For eg. fraction \(\frac{1}{2}\) can be written as \(0.5\) so its first digit is 5 and all the digits after 5 are 0.
Constraints
\(1 \le T \le 100\)
\(1 \le N \le D \le 1000000\)
\(1 \le R \le 1000000\)