Now that we have learned how to represent fractional values in binary, let's extend that same logic to any arbitrary base.
The instructions are left deliberately vague here, but there is really no new logic from the previous problems linked above. If you feel confused, re-read the instructions in those problems and approach them from a generalized perspective.
Input Data
First line will be Q, the quantity of testcases.
Q lines will follow, each containing three space-separated integers in the format
X Y B which describe some fraction X / Y to be represented in base B.
Answer
Should consist of Q space-separated values corresponding to the representations
of each given fraction in the given base.
Truncate all results to the first 10 digits following the radix point.
Capitalize all digits where applicable.
Example
input data:
5
19 27 3
56 78 9
2345 5432 16
99918366 99999999 36
98765432 7 36
answer:
0.201 0.6413413413 0.6E83F5717C 0.ZYXWVN9A85 8EEUB.FFFEPIISBP