All Submissions


Problem Statement

Write a program to convert numbers from one base to another.

Input/Output Specifications
  • The first line of the input contains the number of test cases that follow.
  • Each test case consists of one line, which contains three space separated numbers.
  • The first (decimal) number is the base in which the second number is being provided.
  • The third (decimal) number is the base to which you need to translate the second number.
  • In order to represent values beyond the digit 9, you may use the letters of the alphabet, capital A to Z.
  • Both the original and final bases (the first and third numbers of each testcase) will be in the range 2 to 36 inclusive.
  • The actual number to be translated will have a decimal value less than 1,000,000,000.

Sample Input


3
2 10101 10
10 511 16
36 HACKY 7


Sample Output


21
1FF
501543022


Problem Setter: Kaustubh Karkare

Languages: C,C++,Java

Time Limit: 3 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0