#P8652. [蓝桥杯 2017 国 C] 小数第 n 位
[蓝桥杯 2017 国 C] 小数第 n 位
Description
We know that when dividing integers, sometimes the result is a terminating decimal, and sometimes it is an infinitely repeating decimal.
If we append infinitely many 's to the end of a terminating decimal, then they all have a unified form.
Under the convention above, the task is: given an integer division, find the 3-digit number consisting of the three digits starting from the -th digit after the decimal point.
Input Format
One line with three integers , , and , separated by spaces. is the dividend, is the divisor, and is the position after the decimal point to query ().
Output Format
Output one line with exactly 3 digits, representing the three digits starting from the -th digit after the decimal point in the decimal expansion of .
1 8 1
125
1 8 3
500
282866 999000 6
914
Hint
Time limit: 1 second, 256M. The 8th Lanqiao Cup National Final in 2017.
Translated by ChatGPT 5
京公网安备 11011102002149号