BETA

Difficulty Level:

Basic

Total Submissions: 774 Accuracy:

34.5%

Decimal to any base conversion
     

Given a decimal number and the base to which it should be converted. Convert the given number to the given base.

Input:
The first line of input contains an integer T denoting the number of test cases. The first line of each test case is the base and second line of test case is the decimal number.

Output:
Decimal number converted to the given base is displayed to the user.


Constraints:
1 <= T <= 5
2 <= base <=16
1 <= N <= 999999999

Example:

Input:
3
2
12
16
282
8
83

Output:
1100
11A
123

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.