#abc220b. [abc220_b]Base K
[abc220_b]Base K
Problem Statement
You are given integers and , in base .
Print in decimal.
Notes
For base- representation, see Wikipedia's article on Positional notation.
Constraints
- and are in base- representation.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2
1011 10100
Sample Output 1
220
1011
in base corresponds to in base .
10100
in base corresponds to in base .
We have , so print .
Sample Input 2
7
123 456
Sample Output 2
15642
123
in base corresponds to in base .
456
in base corresponds to in base .
We have , so print .