Your task is to implement a Python module in /app/solution.py that satisfies exactly two skills: (1) the original algorithmic task to compute the sum of the first n decimal digits of a/b, and (2) file I/O to read input from a file and write output to a file. The solution should be a single, cohesive program (not two separate tasks).
Functionality (algorithm)
Implement a Python function calculate_fraction_sum(a: int, b: int, n: int) -> int that computes the sum of the first n digits after the decimal point in the decimal expansion of a/b. The function must retrieve each digit after the decimal point by performing the necessary arithmetic operations.
File I/O (read/write)
The program must read input from a file and write output to a file as part of the same cohesive solution.
Input source: /app/input.txt containing three integers a, b, n separated by whitespace (spaces or newlines).
Output destination: /app/output.txt containing a single integer—the sum of the first n decimal digits of a/b.
File and integration details
The solution must be implemented in a file named /app/solution.py.
The module should expose the function calculate_fraction_sum(a, b, n) and also include a small driver that:
Reads a, b, n from /app/input.txt,
Calls calculate_fraction_sum(a, b, n),
Writes the resulting integer to /app/output.txt.
Example
Input file /app/input.txt:
1 3 5
Output file /app/output.txt should contain:
15
Explanation: 1/3 = 0.33333..., the sum of the first 5 digits after the decimal is 3+3+3+3+3 = 15.