Decimal Digit
InterviewTime limit2sMemory limit128 MB
Simulate long division of A by B to output the N-th digit after the decimal point.
- Level
Easy3 of 10
- Topics
- Simulation, Math, Implementation
- Solved
- No attempts yet
Problem
Given a dividend (numerator) A and a divisor (denominator) B, find the N-th digit after the decimal point in A / B. For instance, if A = 3, B = 4, and N = 1, then A / B = 0.75, so the answer is 7.
Input
The first line contains three integers A, B, and N separated by spaces. The values satisfy 1 <= A, B <= 100,000 and 1 <= N <= 1,000,000.
Output
Print the N-th digit after the decimal point in A / B.