Problems
Write a program that, given a number
The digits used in
Constraints:
Input
The input consists of at most
The end of input is indicated by a line containing
Each test case contains three values separated by spaces:
Output
For each test case, print the number S converted from base
Example #1
2 11010 8
2 10110 10
10 2543 16
16 ABC 8
0
32
22
9EF
5274
Example #2
19 23IEIAE43 11
9 145287560667 2
0
14A10226AA8
101100001000111000101010011111100001
Tag
Source
JUNGOL - comkiwer