func_code_string: #include <bits/stdc++.h>   using namespace std;   const unsigned long long MOD = 1e9 + 7;   const int INF = 1e9;   const unsigned long long INF64 = 9e18;   const long double EPS = 1e-9;   const long double PI = 3.14159265358979310000;   const unsigned long long MD = 535355424;   const unsigned long long T = 25342;   const int N = 200001;   const int M = 501;   int n, k;   bool prov(unsigned long long v) {     unsigned long long s = 0, kk = 1;     while (v / kk > 0) {       s += v / kk;       kk *= k;     }     if (s >= n)       return 1;     else       return 0;   }   int main() {     cin >> n >> k;     if (k == 1) {       cout << 1 << endl;       return 0;     }     unsigned long long l, r, m;     l = 0;     r = INF64;     while (l + 1 < r) {       m = (l + r) / 2;       if (prov(m))         r = m;       else         l = m;     }     cout << r;     return 0;   }   