#P5432. A/B Problem(高精度除法Ⅱ)
A/B Problem(高精度除法Ⅱ)
Problem Description
You are given two positive integers . Find .
To rule out some brute-force solutions, you must process the answer as follows.
Let the answer be , and construct a polynomial :
$$F(x) = \sum\limits_{i=0}^{\lfloor \lg r \rfloor} (\lfloor 10^{-i}r \rfloor \bmod 10) \cdot x^i$$Simply put, from the lowest digit to the highest digit of , each digit is used as the coefficient of one term of .
Let the highest non-zero degree of be . You need to find a degree- polynomial such that:
Take the coefficients of modulo , then output the coefficients of in increasing order of degree.
It is guaranteed that such a exists.
Input Format
Two lines, each containing one positive integer, which are and , respectively.
Output Format
Output one line with integers, the coefficients of .
19260817
114514
873463809 93585408 943652865
Hint
Sample Explanation
$\left\lfloor \dfrac{19260817}{114514} \right\rfloor = 168$.
The polynomial constructed is .
The corresponding is .
Constraints
For of the testdata, .
Translated by ChatGPT 5