9514: ABC220 —— B - Base K
[Creator : ]
Description
You are given integers $A$ and $B$, in base $K$.
Print $A \times B$ in decimal.
Notes
For base-$K$ representation, see [Wikipedia's article on Positional notation].
Print $A \times B$ in decimal.
Notes
For base-$K$ representation, see [Wikipedia's article on Positional notation].
Input
Input is given from Standard Input in the following format:
```
$K$
$A$ $B$
```
```
$K$
$A$ $B$
```
Output
Print the answer.
Constraints
- $2 \leq K \leq 10$
- $1 \leq A,B \leq 10^5$
- $A$ and $B$ are in base-$K$ representation.
- $1 \leq A,B \leq 10^5$
- $A$ and $B$ are in base-$K$ representation.
Sample 1 Input
2
1011 10100
Sample 1 Output
220
1011 in base 2 corresponds to 11 in base 10.
10100 in base 2 corresponds to 20 in base 10.
We have 11×20=220, so print 220.
10100 in base 2 corresponds to 20 in base 10.
We have 11×20=220, so print 220.
Sample 2 Input
7
123 456
Sample 2 Output
15642
123 in base 7 corresponds to 66 in base 10.
456 in base 7 corresponds to 237 in base 10.
We have 66×237=15642, so print 15642.
456 in base 7 corresponds to 237 in base 10.
We have 66×237=15642, so print 15642.