Write a program that converts the number
N from base
r to decimal.
Input
The program receives two natural numbers as input:
N and
r (2 <= r <= 9). It is guaranteed that the number
N is the correct representation of the number in the number system with the base
r (that is, it contains the numbers from
0 to
r- 1).
Imprint
Display the number in decimal notation.
Examples
Запрещенные операторы:hex;bin;oct;str(;[;list