#d2612. 进制转换
进制转换
Base Conversion
Problem Description
Let's see who doesn't know base conversion — oh, it turns out to be me.
Given non-negative integers in different bases, compute their sum and output it in base .
Use uppercase letters A ~ Z to represent ~ , and lowercase letters a ~ z to represent ~ .
Input Format
The first line contains two integers and .
The next lines each contain an integer followed by a -base number .
Output Format
One -base number, the final result.
Sample Input 1
2 2
2 1
6 10
Sample Output 1
111
Sample Input 2
1 10
52 aA0
Sample Output 2
97864
Sample Input 3
2 52
36 AMD
52 YES
Sample Output 3
dJD