100 atcoder#ABC220B. [ABC220B] Base K
[ABC220B] Base K
Score : points
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.
2
1011 10100
220
1011
in base corresponds to in base .
10100
in base corresponds to in base .
We have , so print .
7
123 456
15642
123
in base corresponds to in base .
456
in base corresponds to in base .
We have , so print .