Problem:
 Score : 200 points    Problem Statement Given is an integer N . Find the number of digits that N has in base K .      Notes For information on base- K representation, see Positional notation - Wikipedia .      Constraints  All values in input are integers.  1 \leq N \leq 10^9  2 \leq K \leq 10         Input Input is given from Standard Input in the following format:  N  K       Output Print the number of digits that N has in base K .        Sample Input 1 11 2      Sample Output 1 4  In binary, 11 is represented as 1011 .       Sample Input 2 1010101 10      Sample Output 2 7       Sample Input 3 314159265 3      Sample Output 3 18

Solution (Python):
n, k = map(int, input().split())

for i in range(32):
    if n // (k**(31-i)) > 0:
        print(31-i+1)
        break

Solution (Python):
N, K = list(map(int, input().split(' ')))
count = 1
com_val = K
while com_val <= N:
    count += 1
    com_val = pow(K, count)
print(count)

Solution (Python):
from math import *
n,k=map(int,input().split())
if k>=n:
    print(1)
    exit()
print(ceil(log(n,k)))

Solution (Python):
n,k = map(int,input().split())
ans=[]
while n:
    if n%k != 0:
        ans.append(n%k)
        n=n//k
    else:
        ans.append(0)
        n = n//k

print(len(ans))

Solution (Python):
N,K=map(int,input().split())
a=N
s=""
while(a):
    a=a//K
    b=a%K
    s=str(b)+s

print(len(s))

Solution (Python):
N,K = map(int,input().split())
n = []
temp = N
count = temp
for i in range(N):
    while count >=K:
        a = count//K
        b = count%K
           
   
        n.append(b)
        count = a
    
    else:
        n.append(count%K)
        break
print(len(n))

Solution (Python):
A, B = map(int, input().split())
xxx = 1000000000
yyy = 0
for i in range(xxx):
    if i == 0:
        continue
    elif A <= (B ** i ) -1:
        yyy = i
        break
print(yyy)

Solution (Python):
from sys import stdin
n, k = [int(x) for x in stdin.readline().rstrip().split()]



def convert_to_n(num, n):
    if (int(num/n)):
        return convert_to_n(int(num/n), n)+str(num%n)
    return str(num%n)

ans = convert_to_n(n, k)  
  
print(len(ans))

Solution (Python):
import math
a = list(map(int, input().split()))
print(math.floor(math.log(a[0],a[1])) + 1)

Solution (Python):
n, k = map(int, input().split())

keta = 0
for i in range(10**10):
    ki = k**i
    if ki > n:
        print(keta)
        break
    else:
        keta += 1

Solution (Python):
n, k = map(int, input().split())
ans = 0
while n > 0:
    n //= k
    ans += 1
print(ans)

Solution (Python):
n = [int(i) for i in input().split()]
a = n[0]
b = n[1]
ans = 0
while (a>0):
    a//= b
    ans += 1
print(ans)

Solution (Python):
N, K = map(int, input().split())
r = 0
while N:
    N //= K
    r += 1
print(r)

Solution (Python):
n, k = list(map(int, input().split()))
count = 0

for i in range(n):
    n = n // k 
    count += 1
    if n <= 0:
        break
    
    

print(count)

Solution (Python):
N, K = map(int, input().split())

a = []
i = 0
while N > 0:
    a.append(N % K)
    N = N // K
    i += 1

ans = ''
while i > 0:
    ans += str(a[i - 1])
    i -= 1

ansl = len(ans)

print(ansl)

Solution (Python):
N, K = map(int, input().split())

i=0
a=1
r=[]

while(N!=0):
  a=N%K
  N=N//K
  i+=1

print(i)

Solution (Python):
num, base = map(int, input().split())
count = 0
while num != 0:
    num //= base
    count += 1
print(count)

Solution (Python):


N, K = map(int, input().split())

m = 1

while K ** (m-1) <= N:
    m += 1

print(m - 1)

Solution (Python):
N, K = map(int, input().split())
a = ''
while(N > 0):
	a = str(N%K) + a
	N //= K
print(len(a))

Solution (Python):
n, k = map(int, input().split())

keta = 0
while 1:
  if n%k == 0:
    n = n/k
  else:
    n = n-n%k
    n = n/k
  keta = keta + 1
  if n == 0:
    break
print(keta)

Solution (Python):
inpl = lambda: list(map(int,input().split()))
N, K = inpl()
n = 1
ans = 0
while n <= N:
    n *= K
    ans += 1
print(ans)

Solution (Python):
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
x2 = 0
x10, n = input().split()
x10 = int(x10)
n = int(n)
x2 = Base_10_to_n(x10, n)
print(len(x2))

Solution (Python):
n, k = map(int, input().split())

r = 0
while k ** r <= n:
  r +=1
print(r)

Solution (Python):
n,k = (int(x) for x in input().split())
l = 1
m = k
while n >= k:
   k = k * m
   l = l+1
   
print(l)

Solution (Python):
import math

l=input().split()
N=int(l[0])
K=int(l[1])
cnt=0
a=N

while True:
    a=math.floor(a/K)
    cnt+=1
    if a==0:break

print(cnt)

Solution (Python):
n,k=map(int,input().split())
a=n
i=1
if n<k:
    print(n)
else:
    while True:
        a=a//k
        i+=1
        if a<k:
            break
    print(i)

Solution (Python):
a,b =map(int, input().split())
ans=0
while a:
	ans +=1
	a //=b
print(ans)

Solution (Python):
import math
n,b = map(int, input().split())
dig = (math.floor(math.log(n) / math.log(b)) + 1)
print(dig)

Solution (Python):
N,K=map(int,input().split())
quotient=N
cnt=1
while quotient>=K:
    remainder=quotient%K
    quotient=(quotient-remainder)/K
    cnt+=1
print(cnt)

Solution (Python):
N,K=map(int,input().split())
ans=''
while N>0:
  ans+=str(N%K)
  N=int(N/K)
print(len(ans))

Solution (Python):
N,K = map(int, input().split())
X = N
a = ""
while X > 0:
  a = str(X%K) + a
  X = X//K

  
print(len(a))

Solution (Python):
import math
import fractions

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p
'''
p = 10 ** 9 + 7
N = 10 ** 6 + 2
fact = [1, 1]  
factinv = [1, 1]  
inv = [0, 1]  

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)
    
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p
'''




n,k = list(map(int, input().split()))

count = 0
now = 1
for i in range(99999):
    if(now<=n):
        now*=k
        count+=1
    else:
        break
        
print(count)

Solution (Python):
import numpy as np

N, K = map(int, input().split())
L = np.array([])
while N > 0:
  L = np.append(L, N%K)
  N /= K
  N = np.floor(N)
  
print(len(L))

Solution (Python):
l1 = input()
l1 = l1.split()
N = int(l1[0])
K = int(l1[1])
ans = 0

while True:
    q, mod = divmod(N, K)
    N = q
    ans += 1

    if q <= 0:
        break

print(ans)

Solution (Python):
import math
 
N, K = map(int, input().split())
P = math.log(N, K)
Q = math.floor(P)
 
print(Q + 1)

Solution (Python):

import string
numbers = "0123456789"
alphabets = string.ascii_letters
characters = numbers + alphabets


def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
 
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result


def main():
    n, k = map(int, input().split(' '))

    after = base_cvt(n, k)
    print(len(after))

    return 0


if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
p = 1
check = K
while N >= check:
  p += 1
  check += (K-1)*K**(p-1)
print(p)

Solution (Python):
n, k = map(int, input().split())
a, cou = k, 1
while n+1 > a:
  a *= k
  cou += 1
print(cou)

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from functools import *
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def Golf():
    *a,=map(int,open(0))
def S_():
    return input()
def IS():
    return input().split()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'

    mp=[1]*(w+2)
    found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[1]+[mp_def[j] for j in s]+[1]
    mp+=[1]*(w+2)
    return h+2,w+2,mp,found
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['YES','NO']
Yn=['Yes','No']

mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase


input=lambda: sys.stdin.readline().rstrip()
 
def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

class Comb:
    def __init__(self,n,mo=10**9+7):
        self.fac=[0]*(n+1)
        self.inv=[1]*(n+1)
        self.fac[0]=1
        self.fact(n)
        for i in range(1,n+1):
            self.fac[i]=i*self.fac[i-1]%mo
            self.inv[n]*=i
            self.inv[n]%=mo
        self.inv[n]=pow(self.inv[n],mo-2,mo)
        for i in range(1,n):
            self.inv[n-i]=self.inv[n-i+1]*(n-i+1)%mo
        return
    
    def fact(self,n):
        return self.fac[n]
        
    def invf(self,n):
        return self.inv[n]

    def comb(self,x,y):
        if y<0 or y>x:
            return 0
        return self.fac[x]*self.inv[x-y]*self.inv[y]%mo


show_flg=False
show_flg=True

ans=0

N,K=LI()
def keta(n,k):
    t=1
    for i in range(100):
        t*=k
        if n<t:
            return i+1
ans=keta(N,K)
print(ans)

Solution (Python):
n,k = map(int, input().split())
ans = 0
c = 0
while n >= k**c:
    c += 1
print(c)

Solution (Python):
N, K = map(int, input().split())
n = 0
while True:
    if pow(K, n) <= N < pow(K, n + 1):
       break
    n += 1
print(n + 1)

Solution (Python):

N, K = map(int, input().split())
num = 1
bor = K
while  True:
    if N < bor:
        print(num)
        break
    else:
        num = num + 1
        bor = bor * K

Solution (Python):
i = list(map(int, input().split()))
N=i[0]
K=i[1]
def abc(N,K,x):
    if N-(K**x)>=0:
      abc(N,K,x+1)
    else:
        print(x)
abc(N,K,1)

Solution (Python):
N,K=map(int,input().split())
cnt=0
while N/K:
  cnt+=1
  N//=K
print(cnt)

Solution (Python):

import string

numbers = "0123456789"
alphabets = string.ascii_letters
characters = numbers + alphabets


def convert(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)

    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)

    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp % n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp % n
    result = characters[idx] + result
    return result


def main():
    n, k = map(int, input().split(' '))

    after = convert(n, k)
    print(len(after))

    return 0


if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin


def rec(n, k, cnt):
    if n < k:
        return cnt + 1
    else:
        q, mod = divmod(n, k)
        cnt += 1
        n = q
        return rec(n, k, cnt)


def main():
    N, K = [int(x) for x in stdin.read().rstrip().split()]
    print(rec(N, K, 0))


if __name__ == "__main__":
    main()

Solution (Python):
def base_changer(number,base):
    buff=97+abs(base-10)
    dic={};buff2='';buff3=10
    for i in range(97,buff+1):
        dic[buff3]=chr(i)
        buff3+=1   
    while(number>=base):
        mod=int(number%base)
        number=int(number//base)
        if (mod) in dic.keys():
            buff2+=dic[mod]
            continue
        buff2+=str(mod)
    if (number) in dic.keys():
        buff2+=dic[number]
    else:
        buff2+=str(number)

    return buff2[::-1]  
N,K = map(int, input().split())
print(len(base_changer(N,K)))

Solution (Python):
N, K = map(int, input().split())

digit = 0

while K**digit <= N:
    digit += 1

print(digit)

Solution (Python):
n, k = map(int, input().split())
count = 1
while n >= k ** count:
    count += 1
print(count)

Solution (Python):
n, k = map(int, input().split())

i = 1
while(n >= k):
    n = n // k
    i = i + 1

print(i)

Solution (Python):
import itertools
N,K = map(int,input().split())

for i in itertools.count(0):
  if N//(K**i)<K:
    print(i+1)
    break

Solution (Python):
def toStr(n,base):
    convertString = "0123456789ABCDEF"
    if n < base:
        return convertString[n]
    else:
        return toStr(n//base,base) + convertString[n%base]

a,b = map(int,input().split())
print(len(toStr(a,b)))

Solution (Python):
N,K=map(int,input().split())
p=0
while N/K>=1:
  N=N/K
  p=p+1
print(p+1)

Solution (Python):
n,k=map(int,input().split())

nn=n
icnt=0
while nn>0:
    icnt=icnt+1
    nn=nn//k
    
print(icnt)

Solution (Python):
n, k = map(int,input().split())

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out


print(len(Base_10_to_n(n, k)))

Solution (Python):
n, k = map(int, input().split())
x = k
ans = 1
while n >= x:
    x *= k
    ans += 1

print(ans)

Solution (Python):
def toStr(n,base):
    convertString = "0123456789ABCDEF"
    if n < base:
        return convertString[n]
    else:
        return toStr(n//base,base) + convertString[n%base]

a,b = map(int,input().split())
print(len(toStr(a,b)))

Solution (Python):
def base_changer(number,base):
    buff=97+abs(base-10)
    dic={};buff2='';buff3=10
    for i in range(97,buff+1):
        dic[buff3]=chr(i)
        buff3+=1   
    while(number>=base):
        mod=int(number%base)
        number=int(number//base)
        if (mod) in dic.keys():
            buff2+=dic[mod]
            continue
        buff2+=str(mod)
    if (number) in dic.keys():
        buff2+=dic[number]
    else:
        buff2+=str(number)

    return buff2[::-1]  
N,K = map(int, input().split())
print(len(base_changer(N,K)))

Solution (Python):
def toStr(n, base):
    convertString = "0123456789ABCDEF"
    if n < base:
        return convertString[n]
    else:
        return toStr(n // base, base) + convertString[n % base]


N, K = input().split()
print(len(toStr(int(N), int(K))))

Solution (Python):
def keisan2(n,k,depth):
    n = n//k
    if n == 1:
        return depth+1
    elif n == 0:
        return depth
    else:
        return keisan2(n,k,depth+1)
n,k = map(int,input().split())
print(keisan2(n,k,1))

Solution (Python):
N, K = map(int, input().split())
count = 1
while N >= K:
    N //= K
    count += 1
print(count)

Solution (Python):


n, k = map(int, input().split())

ans = 0
while True:
    if n<1:
        break
    n = n//k
    ans += 1
print(ans)

Solution (Python):
n,k=map(int,input().split())

for i in range(0,1000):
  if k**i <= n < k**(i+1):
    print(i+1)

Solution (Python):
def toStr(n, base):
    convertString = "0123456789ABCDEF"
    if n < base:
        return convertString[n]
    else:
        return toStr(n // base, base) + convertString[n % base]


N, K = input().split()
print(len(toStr(int(N), int(K))))

Solution (Python):
import math

num, base = input().split(' ')
print(int(math.log(int(num), int(base)) + 1))

Solution (Python):
import math

N, R = map(int, input().split())
X = math.log(N + 0.000001, R)
Y = math.ceil(X)

print(Y)

Solution (Python):
n,k=map(int,input().split())
cnt=0
while(n>1):
    cnt+=1
    n=n//k
if n>=1:
    cnt+=1
print(cnt)

Solution (Python):
n, k = map(int, input().split())
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
ans = len(Base_10_to_n(n, k))
print(ans)

Solution (Python):
def toStr(n, base):
    convertString = "0123456789ABCDEF"
    if n < base:
        return convertString[n]
    else:
        return toStr(n // base, base) + convertString[n % base]


N, K = input().split()
print(len(toStr(int(N), int(K))))

Solution (Python):
N,K = map(int, input().split())
i=0
while N >= K**i:
    i = i+1
print(i)

Solution (Python):
N, K = map(int, input().split())
count = 0
while N:
    count += 1
    N //= K
print(count)

Solution (Python):
N,K=map(int,input().split())
a=0
for i in range(10000000):
    a+=1
    if N<(K**i):
        break
print(a-1)

Solution (Python):
def base_changer(number,base):
    buff=97+abs(base-10)
    dic={};buff2='';buff3=10
    for i in range(97,buff+1):
        dic[buff3]=chr(i)
        buff3+=1   
    while(number>=base):
        mod=int(number%base)
        number=int(number//base)
        if (mod) in dic.keys():
            buff2+=dic[mod]
            continue
        buff2+=str(mod)
    if (number) in dic.keys():
        buff2+=dic[number]
    else:
        buff2+=str(number)

    return buff2[::-1]  
N,K = map(int, input().split())
print(len(base_changer(N,K)))

Solution (Python):
N,K = map(int, input().split())
A = 1
k = K
while N+1 > k:
    k = k * K
    A = A+1
print(A)

Solution (Python):
import math
N,K = input().split(" ")
print(math.floor(math.log(int(N),int(K))+1))

Solution (Python):
n, k = map(int, input().split())

ans = 0

while n > 0:
    ans += 1
    n //= k

print(ans)

Solution (Python):
a = raw_input()
n = int(a.split(" ")[0])
k = int(a.split(" ")[1])

def toStr(n,base):
   convertString = "0123456789ABCDEF"
   if n < base:
      return convertString[n]
   else:
      return toStr(n//base,base) + convertString[n%base]

res = toStr(n,k)
print(len(str(res)))

Solution (Python):
n, k = [int(i) for i in input().split()]

cnt = 0
while n!=0:
  n = int(n/float(k))
  cnt += 1
  
print(cnt)

Solution (Python):



import sys
from collections import deque as deq

N, K = map(int, input().split())

R = 0

while N >= K:
    N /= K
    R += 1

print(R + 1)

Solution (Python):
N, K = map(int, input().split())
def Base_10_to_n(N, K):
    if (int(N/K)):
        return Base_10_to_n(int(N/K), K)+str(N%K)
    return str(N%K)

x10 = 35
x2 = Base_10_to_n(N, K)
x2 = str(x2)
print(len(x2))

Solution (Python):
import math

n, k = map(int, input().split())

a = int(math.log(n, k))

for i in range(a + 2):
    if n < k**i:
        print(i)

Solution (Python):
import math

def resolve():
    N,K=map(int,input().split())
    A=math.log(N,K)
    if N==1:
      print(1)
      return
    print(math.ceil(A))




if __name__ == "__main__":
    resolve()

Solution (Python):
nk =  list(map(int, input().split()))
a = nk[0]
count = 1

while a/nk[1] >= nk[1] :

    a=a/nk[1]

    count+=1

if count > 1:
    count+=1

print(count)

Solution (Python):
n,k = map(int,input().split())
ans = 0
while n != 0:
    n = n//k
    ans += 1
print(ans)

Solution (Python):
n, k = map(int, input().split())

a = []
while True:
  if n < 1:
    break
  a.append(n%k)
  n //= k

print(len(a))

Solution (Python):
s = input().split()

n = int(s[0])
k = int(s[1])
cnt = 1

while n >= k:
    n = n//k
    cnt += 1

print(cnt)

Solution (Python):
def base_changer(number,base):
    buff=97+abs(base-10)
    dic={};buff2='';buff3=10
    for i in range(97,buff+1):
        dic[buff3]=chr(i)
        buff3+=1   
    while(number>=base):
        mod=int(number%base)
        number=int(number//base)
        if (mod) in dic.keys():
            buff2+=dic[mod]
            continue
        buff2+=str(mod)
    if (number) in dic.keys():
        buff2+=dic[number]
    else:
        buff2+=str(number)

    return buff2[::-1]  
N,K = map(int, input().split())
print(len(base_changer(N,K)))

Solution (Python):
n,k=[int(i) for i in input().split()]
ans=0
while n>0:
    n//=k
    ans+=1
print(ans)

Solution (Python):
NK = input().split()

N = int(NK[0])
K = int(NK[1])

ans = 1
while True:
    if N >= K**ans:
        ans += 1
    else:
        break
print(ans)

Solution (Python):
n,k = map(int,input().split())
i = 1

while 1:
  if n <= k**i - 1:
    print(i)
    exit()
  i += 1

Solution (Python):

X,n= list(map(int, input().split())) 

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)

res=(Base_10_to_n(X,n))
print(len(res))

Solution (Python):
import math

n, k = map(int,input().split())

if float.is_integer(math.log(n, k)):
    print(math.ceil(math.log(n, k))+1)
else:
    print(math.ceil(math.log(n, k)))

Solution (Python):
N, K = map(int, input().split())

total = 0

while True:
    if N < K:
        total += 1
        break
    else:
        N, m = divmod(N, K)
        total += 1
       
print(total)

Solution (Python):
N,R = map(int,input().split(" "))

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

x10 = N
x2 = Base_10_to_n(x10, R)
print(len(x2))

Solution (Python):
N,K = map(int,input().split())


n = 1
while True:
    if  K** (n-1) <= N < K**n:
        break
    else:
        n += 1
print(n)

Solution (Python):
N, K = map(int, input().split())
count = 0
while( N - K**count >= 0):
    count += 1
print(count)

Solution (Python):
n, k = map(int, input().split())

count = 1
while True:
    if n / k >= 1:
        n  = int(n / k)
        count += 1
    else:
        break

print(count)

Solution (Python):
def toStr(n,base):
  convertString = "0123455789ABCDEF"
  if n<base:
    return convertString[n]
  else:
    return toStr(n//base,base)+ convertString[n%base]
a,b = map(int,input().split())
print(len(toStr(a,b)))

Solution (Python):
n,k = map(int,input().split())
ans = 0
while(n>=1):
  n //= k
  ans += 1
print(ans)

Solution (Python):
import math
N,K = map(int, input().split()) 
if N==1:
  print(1)
else:
  print(math.ceil(math.log(N, K)))

Solution (Python):
import math
def f(x, n):
    if x//n:
        return f(x//n, n) + str(x%n)
    return str(x%n)
n, k = map(int, input().split())
print(len(f(n, k)))

Solution (Python):
from math import floor
N, K = list(map(int, input().split()))
x = 0
while N > 0:
    if (N/K) < 0:
        break
    else:
        N = floor(N/K)
        x += 1

print(x)

Solution (Python):
result = ""
i = input().split()
n = int(i[0])
b = int(i[1])
while n > 0:
    result = str(n%b) + result
    n = n//b


print(len(result))

Solution (Python):
n, k = (int(x) for x in input().split())
ans = 1
tmp = 0
while True:
    tmp = k ** ans - 1
    if n <= tmp:
        break
    ans += 1
print(ans)

Solution (Python):
import math
 
n, k = [int(i) for i in input().split()]
 
tmp = math.log(n, k)
result = int(tmp)


print(result+1)

Solution (Python):
n,k = map(int, input().split())

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy > 0:
        out = str(X_dumy % n) + out
        X_dumy = int(X_dumy / n)
    return out


x2 = Base_10_to_n(n, k)
print(len(x2))

Solution (Python):
import math
N, K = map(int, input().split())
C=math.log(N,K)
print(int(C)+1)

Solution (Python):
input = input().split(" ")
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
x10 = int(input[0])
xn = Base_10_to_n(x10, int(input[1]))
print(len(xn))

Solution (Python):
a, b = map(int, input().split())
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)

print(len(Base_10_to_n(a, b)))

Solution (Python):
from math import log10
n,k = map(int,input().split())
print(int(log10(n)/log10(k))+1)

Solution (Python):
N,K = map(int,input().split())
ans = 1
while True:
    if K**ans-1>= N:
        print(ans)
        exit()
    else:ans += 1

Solution (Python):
n,k = map(int, input().split())
res = 1
while not (k**(res-1)<=n<k**res):
    res += 1
print(res)

Solution (Python):

s = input().split()
n = int(s[0])
k = int(s[1])

c =0
while n>(k-1):
    a = n%k
    n = (n-a)/k
    c += 1
print(c+1)

Solution (Python):
import math
N, K = input().split(" ")
print(math.floor(math.log(int(N),int(K))+1))

Solution (Python):
import math
N, K = input().split()

print(math.floor(math.log(int(N), int(K)))+1)

Solution (Python):
a, n = map(int, input().split())
cnt = 0
nn = 1
while True:
    cnt += 1
    nn *= n
    if a < nn:
        break
print(cnt)

Solution (Python):
input_arr = input().split(" ")
n = int(input_arr[0])
k = int(input_arr[1])

ans = ""

num = n
while(num > 0):
    ans += str(num % k)
    num //= k

print(len(ans))

Solution (Python):
import math
N, K = map(int, input().split())
print(math.floor(math.log(N, K) + 1))

Solution (Python):
n, k = map(int, input().split())
_k = k
ans = 1
while n >= _k:
    _k *= k
    ans += 1
print(ans)

Solution (Python):
N, K = map(int, input().split())

for i in range(1, 10 ** 10):
  if N < (K ** i):
    print(i)
    break

Solution (Python):
import math

N, K = map(int, input().split())

log = math.log(N, K)
print(int(log) + 1)

Solution (Python):
def toStr(n,base):
    convertString = "0123456789ABCDEF"
    if n < base:
        return convertString[n]
    else:
        return toStr(n//base,base) + convertString[n%base]

a,b = map(int,input().split())
print(len(toStr(a,b)))

Solution (Python):
n, k = map(int, input().split())
cnt = 0
val = k
for i in range(n):
    if val > n:
        break
    val *= k
    cnt += 1
    
    
    if val > n:
        break
    
    
    
print(cnt+1)

Solution (Python):
N, K = map(int, input().split())
def solve_digits(N, K):
	res = ''
	while N > 0:
		res += str(N % K)
		N = N // K
	return res

print(len(solve_digits(N, K)))

Solution (Python):
import math
N, K = list(map(int, input().split()))
buf = []
while(N != 0):
    buf.insert(0, str(N % K))
    N = math.floor(N / K)
print(len(buf))

Solution (Python):
n,k = map(int, input().split())
if n==0:
  print('0')
else:
  char='0123456789'
  result=''
  i=0
  while(n>0):
    result=char[n%k]+result
    n=n//k
    i=i+1
  print(i)

Solution (Python):
N, K = map(int,input().split())

qs = []

q,mod = divmod(N,K)
qs.append(mod)
while q != 0:
    q,mod = divmod(q,K)
    qs.append(mod)
    
print(len(qs))

Solution (Python):
import math

n, k = map(int, input().split())
digits = 0

while True:
  n = math.floor(n/k)
  digits += 1
  if n == 0:
      break
  
print(digits)

Solution (Python):
N, K = map(int, input().split())

sum = 0
for i in range(0, 10**9):
    sum += pow(K, i) * (K - 1)
    if (sum >= N):
        print(i + 1)
        break

Solution (Python):
s=input().split()
n=int(s[0])
k=int(s[1])
keta=1
while n/k >= 1:
  keta+=1
  n=int(n/k)
print(keta)

Solution (Python):
a,b=map(int,input().split())
c=1
d=0
while 1:
  
  
  if a-c<0:
    break
  d+=1
  c*=b
  
print(d)

Solution (Python):
N, K = map(int, input().split())

x = 0

for j in range(1, 46):
    if N >= (K**j):
        continue
    else:
        print(j)
        break

Solution (Python):
import math

S, T=map(int, input().split())

ans=math.floor(math.log(S, T))+1
print(ans)

Solution (Python):
N,K = map(int,input().split())
ans=1
while N>=K:
    N//=K
    ans+=1
print(ans)

Solution (Python):

"""
Created on Fri Jan 24 14:37:00 2020

@author: matsui
"""

N,K=map(int,input().split())

for i in range(31):
    if K**i > N:
        ans=i
        break

print(ans)

Solution (Python):
N=input().split()
A=int(N[0])
B=int(N[1])
c=0
while A >= B:
  A=A//B
  c+=1
  
c=c+1
print(c)

Solution (Python):
N, K = map(int, input().split())

ans = 0
while N >= (K ** ans):
    ans += 1

print(ans)

Solution (Python):
N,K=map(int, input().split())  
x=N
ans = []
while x>0:
  ans.append(x%K)
  x = x//K
  
print(len(ans))

Solution (Python):
def ten_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

def main():
    N, K = [int(_) for _ in input().split()]
    ans = ten_to_n(N, K)
    print(len(ans))
main()

Solution (Python):
import numpy as np

n, k = map(int, input().split())

string_N = str(np.base_repr(n, k))

print(len(string_N))

Solution (Python):
def sisuu(X, n):
    if (int(X/n)):
        return sisuu(int(X/n), n) + str(X%n)
    return  str(X%n)

N, K = [int(x) for x in input().split()]

hennkan = sisuu(N, K)
ketasuu = len(str(hennkan))

print(ketasuu)

Solution (Python):
import numpy as np
N,K=map(int,input().split())
print(len(str(np.base_repr(N,K))))

Solution (Python):
data = list(map(int, input().split()))
n = data[0]
k = data[1]


digit = 1
while True:
    if n < k:
        print(digit)
        exit()
    n = n / k
    digit += 1
    if n < k:
        print(digit)
        exit()

Solution (Python):
N,k = map(int,input().split())

a = True
remain = N
dir_list = []

while a:
    if  remain // k > 0:
        dir_list.append(remain)
        remain = remain // k
    else:
        a = False

print(len(dir_list)+1)

Solution (Python):
import math
n,k = map(int,input().split())
count = 0
if n == 1:
	print(1)
else:
	count = math.ceil(math.log(n,k))
	print(count)

Solution (Python):
import math
n, k = map(int, input().split())
print(math.floor(math.log(n, k) + 1))

Solution (Python):
N,K=map(int, input().split())
n=0
while N>=1:
  N=N/K
  n=n+1
print(n)

Solution (Python):

def main():
    n, k = map(int, input().split())
    i = 0
    while n:
        n = n//k
        i+=1
    print(i)
main()

Solution (Python):
def Ten_to_n(X, n):
    if (int(X / n)):
        return Ten_to_n(int(X / n), n) + str(X % n)
    return str(X % n)


def main():
    B = list(map(int, input().split()))
    
    res = Ten_to_n(B[0], B[1])
    print(len(res))


main()

Solution (Python):
def calc(N, n):
    res = 0
    while N > 0:
        res += 1
        N //= n
    return res
    
if __name__ == '__main__':
    k, R = map(int, input().split())
    print(calc(k, R))

Solution (Python):
n,sin=map(int,input().split(' '))
ls=[]
while n>=sin:
    ls.append(n%sin)
    n=n//sin
ls.append(n)

print(len(ls))

Solution (Python):
n, k = list(map(int, input().split(" ")))
result = ""
while n >= k:
  result = str(n % k) + result
  n = int(n / k)
result = str(n % k) + result
print(len(result))

Solution (Python):
import math

line=list(map(int,input().split()))
a=line[0]
b=line[1]

n=1+math.log(a,b)
print(math.floor(n))