100 atcoder#ABC200B. [ABC200B] 200th ABC-200
[ABC200B] 200th ABC-200
Score : points
Problem Statement
You are given an integer . Do the following operation times on it and print the resulting integer.
- If is a multiple of , divide it by .
- Otherwise, see as a string and append to the end of it.- For example, would become and would become .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer as an integer.
2021 4
50531
Applying the operation on results in becoming $2021 \rightarrow 2021200 \rightarrow 10106 \rightarrow 10106200 \rightarrow 50531$.
40000 2
1
8691 20
84875488281
The answer may not fit into the signed -bit integer type.