Problem F
Random Digital Exponentiation
For instance, for $a = 243$ and an encryption key of 7 4 3, the encrypted value $b$ would be $b = 2^7 \cdot 10^2 + 4^4 \cdot 10 + 3^3 = 15\, 387$.
Given a plaintext value $a$ and an encrypted value $b$, find the encryption key that was used!
Input
The input will contain a single test case containing two numbers $a$ and $b$ ($0 \le a \le b \le 2\, 147\, 483\, 647$).
Output
Print the encryption key, which is the list of exponents to which each digit in $a$ was raised, separated by spaces, starting from the leftmost digit’s exponent. Each exponent should be a natural number. You are guaranteed that the encryption key exists and is unique.
Sample Input 1 | Sample Output 1 |
---|---|
243 15387 |
7 4 3 |