TCONNUM  Simple Numbers Conversion
Wersja polska  English version 
Every integer number n is represented in positional number system of base r by a sequence of digits 0 ≤ d_{i} < r, so the value is equal to:
n = d0 + r * d1 + r^{2} * d2 + r^{3} * d3 + ...
Your task is to convert a given number in rbase represantation into sbase representation, for example: decimal 231 into binary 11100111. Assume that r ≤ 36 and the digits are 0,1,2,3,4,5,6,7,8,9, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z.
Input
N [the number of series ≤ 1000]
n r s [n ≤ 10^{1000}, r,s ≤ 36]
Output
n [sbase representation of number n]
Text grouped in [ ] does not appear in the input and output file.
Example
Input: 3 231 10 2 ABC 15 10 XYZ 36 2 Output: 11100111 2427 1010101111111011
Test cases
There are five categories of the input data:

Test case 1: (1 pt), r = 2 and s = 10, or conversely, n≤ 10^{9}, N = 100,

Test case 2: (1 pt), 2 ≤ r,s ≤ 10, n≤10^{9}, N = 1000,

Test case 3: (1 pt), 2 ≤ r,s ≤ 36, n≤ 10^{9}, N = 1000,

Test case 4: (3 pts), 2 ≤ r,s ≤ 10, n≤ 10^{1000}, N = 1000,

Test case 5: (4 pts), 2 ≤ r,s ≤ 36, n≤ 10^{1000}, N = 1000.
hide comments
phanindra_28:
20180709 19:43:24
what is meant by


harsh27:
20180207 05:14:30
What is meant by


Lionel Messi:
20171108 09:19:44
I have written the Java code for this problem for about 3 hours, then realise that there's no Java choice in submit options T_T Last edit: 20171108 09:21:08 

joji:
20151020 06:25:20
What is meant by


Saad:
20150408 11:36:53
:D 

Tamal Chowdhury:
20150323 18:53:54
I am confused about


ZaidRehman A.R. Qureshi:
20150216 03:58:34
can i submit this code in java ? Last edit: 20150216 03:58:54 

Julian Leyh:
20141208 05:26:32
Why is this only for such a small set of languages? I would like to submit a solution in Ada.. 

Andika Tanuwijaya:
20141208 05:26:32
can someone explain what the categories means?


Micha³ Ma³afiejski:
20141208 05:26:32
please visit our forum, and try to describe the problem in details...

Added by:  mima 
Date:  20041013 
Time limit:  1s3s 
Source limit:  5000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  ASM32 BF C C++ 4.3.2 CPP C99 PASGPC PASFPC 