Base Conversion 2
InterviewTime limit0.5sMemory limit256 MB
Convert the decimal number N to base B, writing digits above 9 as uppercase letters.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
A number written in base 10 is given. Write a program that converts it to base and prints the result.
In a base above 10, some digits cannot be written with the characters 0 to 9. Those digits use uppercase letters. A is 10, B is 11, and in the same way F is 15, Y is 34, and Z is 35.
Input
The first line contains and , separated by a space. is a natural number no greater than one billion, and is an integer with .
Output
Print written in base on the first line. Write digits above 9 as uppercase letters, and do not add leading zeros.