102201: [AtCoder]ABC220 B - Base K

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:16 Solved:0

Description

Score : $200$ points

Problem Statement

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.

Constraints

  • $2 \leq K \leq 10$
  • $1 \leq A,B \leq 10^5$
  • $A$ and $B$ are in base-$K$ representation.

Input

Input is given from Standard Input in the following format:

$K$
$A$ $B$

Output

Print the answer.


Sample Input 1

2
1011 10100

Sample Output 1

220

1011 in base $2$ corresponds to $11$ in base $10$.
10100 in base $2$ corresponds to $20$ in base $10$.
We have $11 \times 20 = 220$, so print $220$.


Sample Input 2

7
123 456

Sample Output 2

15642

123 in base $7$ corresponds to $66$ in base $10$.
456 in base $7$ corresponds to $237$ in base $10$.
We have $66 \times 237 = 15642$, so print $15642$.

Input

题意翻译

给出两个 $K$ 进制数 $A,B$,求 $A\times B$ 在十进制下的值。 $1\le K\le 10,1\le A,B\le 10^5$。

Output

得分:200分

问题描述

你得到了以K进制表示的整数A和B。

以十进制打印A * B。

注意事项

关于K进制表示,请参阅Wikipedia上关于Positional notation的文章

约束条件

  • 2 ≤ K ≤ 10
  • 1 ≤ A,B ≤ 10^5
  • A和B都是以K进制表示的。

输入

输入从标准输入以以下格式给出:

$K$
$A$ $B$

输出

打印答案。


样例输入1

2
1011 10100

样例输出1

220

二进制的1011对应十进制的11。

二进制的10100对应十进制的20。

我们有11 * 20 = 220,所以打印220。


样例输入2

7
123 456

样例输出2

15642

七进制的123对应十进制的66。

七进制的456对应十进制的237。

我们有66 * 237 = 15642,所以打印15642。

加入题单

算法标签: