#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
using namespace std;
 
int N;
long long NUM;
string ans;
string rule = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
void change(long long num)
{
    while(num != 0)
    {
        int temp = num % N;
        num /= N;
        
        ans = rule[temp] + ans;
    }
}
 
int main(void)
{
//    freopen("B11005_input.txt", "r", stdin);
    
    cin >> NUM >> N;
    
    change(NUM);
    
    cout << ans;
    
    return 0;
}
cs

+ Recent posts