HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Fyodor Menshikov. Training > problem:


05E. 50637 - Number systems

Guest
• Discussion of problem (1)

Volume problems

• 03D. 50666 - The card and envelope
• 03E. 50606 - Long product
• 04A. 50634 - Perfect numbers
• 04B. 50635 - Decomposition into terms
• 04C. 50608 - Gangsters
• 04D. 50627 - Area of a polygon
• 02D. 50667 - Intersecting Line Seg...
• 03C. 50615 - Moneybox
• 05E. 50637 - Number systems

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.
Автор: Фёдор Меньшиков, ВГПУ. Difficulty Gamma

Number systems

Russian

Question
Given a positive integer in the i-ary notation. Display this number in the j-ary notation.

Input:
The first line contains the number i and j (in decimal notation), in the second line - the number to convert.

Output:
Bring the required number. If the number begins with a letter in front of it should not be zero.

Restrictions :
2 ≤ (i, j) ≤ 36, to represent the digits 10 ... 35 are used uppercase letters A. .. Z, respectively, the number of digits of the original number does not exceed 1,000.

Sample Input:
10 8
12345

Sample Output:
30071

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

www.contester.ru