HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Arithmetic > problem:


50369 - Base Conversion

Guest
• Discussion of problem (1)

Section problems

• 50394 - Water Bills
• 50651 - Largest power of two
• 50297 - Divisible By Five
• 50332 - Variance of a series
• 50398 - Sum of kth Anti-diagonal
• 50400 - nth Row rth Element of a Table
• 50330 - Find the average of n numbers
• 50401 - Sum of Odd Numbers
• 50369 - Base Conversion
• 50407 - Missing Number
• 50336 - Buying Carpets
• 50338 - Convert Into Decimal
• 50404 - Sum of Self Powers
• 50295 - Weighted Average
• 50343 - The number of Ending Zero...
• 50296 - Total Discount Rate
• 50289 - Monthly Allowance

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Convert a from a base into another base

Question:
Given a string that represents a base X number, convert it to equivalent string in base Y. For example: "FE" in base 16 (Hexadecimal) is "254" in base 10 (Decimal) and "11111110" in base 2 (binary).

Input specification
You are first given two integers base1, and base2 which is 2 ≤ (base1, base2) ≤ 36. Then in the following line, you are given a string which is composed of digits (0..9) and/or upper case English letters (A..Z), and the decimal number is in the limit of 263-1.
Note: Letter 'A' represents 10, etc.

Output specification
Show one string, the converted number.

 Sample Input I     Sample Output I   
 16 26
 FDC8
 3I2K


Для отправки решений необходимо выполнить вход.

www.contester.ru