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):
import numpy as np
n,k= map(int,input().split())
dig = int(np.ceil(np.log(n)/np.log(k)))
if k**(dig) == n:
    dig = dig + 1
print(dig)

Solution (Python):
N,K = list(map(int,input().split()))
A = []
A.append(1)

for i in range(N):
    p = K * A[i]
    if p > N:
        print(i+1)
        break
    else:
        A.append(p)

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

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

if K<=N:
    while (N/K)>=1:
        K = K*K_origin
        result += 1

print(result)

Solution (Python):
import math

N, K = [int(i) for i in input().split()]
print(int(math.floor(math.log(float(N)/math.pow(K,2), K))) + 1 + 2)

Solution (Python):
line = input()
x, k = line.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 = Base_10_to_n(int(x), int(k))
str_num = str(ans)
print(len(str_num))

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

n=N
count=0

while n>0:
    n=int(n/K)
    count+=1

print(count)

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

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

for i in range (100000):
    if N < K**i:
        print(i)
        break

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

while n != 0:
	ans += str(n%k)
	n = int(n/k)

print(len(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))

X,n=map(int,input().split())
k = Base_10_to_n(X,n)
print(len(k))

Solution (Python):
X,Y = map(int,input().split())

n=1
for i in range(1000):
   n=n*Y
   if(n>X):
       print(i+1)
       exit()

Solution (Python):
import numpy as np
import math

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

temp = np.log(n)/np.log(k)

if n==1:
    print(1)
else:
    print(math.ceil(temp))

Solution (Python):
def dec_to_base(num,base):  
    base_num = ""
    while num>0:
        dig = int(num%base)
        if dig<10:
            base_num += str(dig)
        else:
            base_num += chr(ord('A')+dig-10)  
        num //= base

    base_num = base_num[::-1]  
    return base_num

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

Solution (Python):
n,k=map(int,input().split())
if k == 10:
    print(len(str(n)))
else:
    count=0
    while True:
        count+=1
        if n < k**count:
            break
    print(count)

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

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

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

n,k = map(int,input().split())
ans = nsin(n,k)
str_ans = str(ans)
print(len(str_ans))

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

print(floor(log(N, K))+1)

Solution (Python):
a, b = input().split()
c = int(a)
d = int(b)
 
flag = True
ans = 1
 
while flag:
  if d ** ans > c:
    flag = False
    break
  else:
    ans += 1
    
print(str(ans))

Solution (Python):

import sys

def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b),b) + str(n%b)
    return str(n%b)

def solve(N: int, K: int):
    return len(base10to(N, K))



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    print(solve(N, K))

if __name__ == '__main__':
    main()

Solution (Python):
import math
N, K = [int(i) for i in input().split()]

if N == 1:
    print(1)
else :
    print(math.ceil(math.log(N, K)))

Solution (Python):
from sys import stdin
s = stdin.readline().rstrip().split()
n, k = int(s[0]), int(s[1])
ans = 0
while(n >= pow(k, ans)):
    ans += 1
    
    

print(ans)

Solution (Python):
n,k = map(int,input().split())
s = True
r = 0
while s:
	if n // (k**r) == 0:
		s = False
	else:
		r = r+1
print(r)

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

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

def numberToBase(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return len(digits[::-1])
  
print(numberToBase(N, K))

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

count = 0

while k**count <= n:
    count += 1

print(count)

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

count = 0

while True:
    N = N // K

    count += 1
    if N == 0:
        break

print(count)

Solution (Python):
import math
n,k=(int(x) for x in input().split())
print(int(math.log(n,k))+1)

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

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

Solution (Python):
import numpy as np
import math

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

log_K = np.log(N)/np.log(K)


ans = int(math.ceil(log_K))

if ans == 0:
    print "1"
else:
    print ans

Solution (Python):


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

for i in range(10**9):
    if(n < k**i):
        print(i)
        break

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

Solution (Python):
import string
digs = string.digits + string.ascii_letters

def int2base(x, base):
    if x < 0:
        sign = -1
    elif x == 0:
        return digs[0]
    else:
        sign = 1
    x *= sign
    digits = []
    while x:
        digits.append(digs[int(x % base)])
        x = int(x / base)
    if sign < 0:
        digits.append('-')
    digits.reverse()
    return ''.join(digits)
a,b = map(int,input().split())

print(len(int2base(a, b)))

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

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

print(len(func(n,k)))

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

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

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

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

print(count)

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 len(out)

print(Base_10_to_n(N, R))

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

i = 1
while n >= k**i:
    i += 1

print(i)

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


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

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

while N != 0:
  A.insert(0, N % K)
  N = int(N / K)
  
print(len(A))

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

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

for count in reversed(range(0,100)):
    if N % (K**count) < N:
        print(count + 1)
        break

Solution (Python):
a,b=input().split()
a=int(a)
b=int(b)
c=b
i=1
while a>=c:
    c=c*b
    i+=1
print(i)

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

ans = 0
while N > 0:
    ans += 1
    N //= K

print(ans)

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

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

ans=0

while N!=0:
  N=N//K
  ans=ans+1

  
print(ans)

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

Solution (Python):
import math

inputs = [int(i) for i in input().split(" ")]

print(math.floor(math.log(inputs[0], inputs[1]))+1)

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

Solution (Python):
import math
n, r = map(int, input().split())

l = math.log(n, r)
    
print(int(l+1))

Solution (Python):
import math
def findNumberOfDigits(n, base):
    dig = (math.floor(math.log(n) / math.log(base)) + 1)
    print(dig)
n, k = input().split()
findNumberOfDigits(int(n), int(k))

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

i = 0
l = k ** i

if n <= k:
    print(1)
    exit(0)

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

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

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

ans = 0
for i in range(1000):
  if k**i>n:
    ans = i
    break
    

print(ans)

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

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

i=1
ans=0
while n>=i:
       i*=k
       ans+=1
print(ans)

Solution (Python):


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


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

Solution (Python):
n, k = map(int, input().split())
count = 0
for _ in range(n):
  if n == 0:
    break
  n = n // k
  count += 1
print(count)

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

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

Solution (Python):
n, k = map(int, input().split())
count = 0
for _ in range(n):
  if n == 0:
    break
  n = n // k
  count += 1
print(count)

Solution (Python):
a = list(map(int,input().split()))

for i in range(10**8):
  if a[1]**i > a[0]:
    break
print(i)

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

while n > 0:
    n, _ = divmod(n, k)
    cnt += 1
print(cnt)

Solution (Python):

import sys

def solve(N: int, K: int):
    i = 0
    while True:
        if N >= (K ** i):
            i += 1
        else:
            print(i)
            break

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    solve(N, K)

if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
num, answer = N, ""
while num:
    mod = N % K
    num = num // K
    answer = chr(48 + mod + 7*(mod > 10)) + answer
print(N) if K == 1 else print(len(answer))

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

print(a)

Solution (Python):
import sys
n,k=map(int,input().split())
for i in range(n):
  if k**i<=n and n<k**(i+1):
    print(i+1)
    sys.exit()

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())
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())
m = 1
ans = 0

while n >= m:
  m *= k
  ans += 1

print(ans)

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

if ceil(log(n,k)) != log(n,k):
    print(ceil(log(n,k)))
else:
    print(ceil(log(n,k))+1)

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

count=0
while True:
    N = N/K
    count += 1
    if N < 1:
        break
print(count)

Solution (Python):
import math

N, K = map(int, input().strip().split())
ans = math.ceil(math.log(N,K))
if ans == 0:
    ans = 1
print(ans)

Solution (Python):
a=input().split()
nm=[]
for i in range(2):
  b=int(a[i])
  nm.append(b)
n=nm[0]
m=nm[1]
t=0
while True:
  if m**t<=n and n<m**(t+1):
    t+=1
    break
  else:
    t+=1
print(t)

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

c = 0
while n:
    n //= k
    c += 1
print(c)

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())
n_dummy = N
out = ''
while n_dummy>0:
  out = str(n_dummy%K)+out
  n_dummy = int(n_dummy/K)

print(len(out))

Solution (Python):
import numpy as np

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

result = 0
for i in range(1, 10**9):
    if (N >= K**(i-1)) & (N<K**i):
        result = i
        break
print(result)

Solution (Python):
N,K = map(int,input().split(" "))
i=0
while(True):
  if(K**i<=N):
    i+=1
    continue
  else:
    print(i)
    break

Solution (Python):
def strr():
 a=raw_input()
 return a
def sstrr():
 a=raw_input().split()
 return a
def intt():
 a=int(raw_input())
 return a
def iintt():
 a=[int(s) for s in raw_input().split()]
 return a
def nestt(t):
 a=[raw_input().split() for s in range(t)] 
 return a

nk=iintt()
n=nk[0]
k=nk[1]
a=0
s=1
while n>=s:
 s*=k
 a+=1
if a==0:
 a=1
print a

Solution (Python):
n,k=map(int,input().split())
for i in range(1,100):
    if n//pow(k,i)<=0:
        print(i)
        break

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

i = 0
c = 0
t = 1
while True:
    if N // t == 0:
        break
    c += 1
    i += 1
    t *= K

print(c)

Solution (Python):
def resolve():
    n, k = map(int, input().split())
    ans =0
    while True:
        ans +=1
        n = n//k
        if n <=0:
            break
    print(ans)
    
if __name__ == "__main__":
    resolve()

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

i = 0
while True:
    if n >= k**i and n < k**(i+1):
        print(i+1)
        break
    i += 1

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

amari_list = []


def hoge(N, K):
    if N == 0:
        return amari_list
    sho = N//K
    amari = N%K

    amari_list.append(amari)
    return hoge(sho, K)

print(len(hoge(n, k)))

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

a = 1
for n in range(32):
    if N < a:
        print(n)
        break
    a *= K

Solution (Python):
import math


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)


N, K = map(int, input().split())
res = int(Base_10_to_n(N, K))
ans = int(math.log10(res) + 1)
print(ans)

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

Solution (Python):
n=list(map(int, input().split()))
C=0
while n[0]>=n[1]**C:
    C+=1
print(C)

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

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

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

dummy = N
out = ''
while dummy > 0:
    out = str(dummy % K) + out
    dummy = dummy // K

print(len(out))

Solution (Python):
n, k = [int(each) for each in input().split(' ')]
for i in range(50):
    if n >= k**i and k**(i+1) > n:
        print(i+1)

Solution (Python):
def main():
    N, K = map(int, input().split())
    x = Base_10_to_n(N, K)
    print(len(x))


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)


if __name__ == '__main__':
    main()

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

Solution (Python):


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



print(ans)

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

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

while(K**t <= N):
	
	t+=1

print(t)

Solution (Python):
N,K=(int(x) for x in 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)

A=Base_10_to_n(N,K)

print(len(A))

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

print(ans)

Solution (Python):

import math
count = 0
N,K=map(int,input().split())
while N>=1:
    N=N//K
    count += 1
print(count)

Solution (Python):
N, K = map(int, input().split())
def numberToBase(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return len(digits[::-1])
print(numberToBase(N, K))

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

Solution (Python):


import sys
import math
import time

import collections
from collections import deque
import queue
import copy






NK = str(input()).split()
N = int(NK[0])
K = int(NK[1])
ans = 1

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

if(N<=K):
  ans = 1


print(ans)

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

Solution (Python):
N, K = map(int, input().split())
ans = []
if N == 0:
  ans = ["0"]
while N != 0:
  ans.append(str(N % K))
  N //= K
ans = ("".join(list(reversed(ans))))
print(len(ans))

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

res = []

while True:
    if N < K:
        break

    m = N % K
    div = N // K

    res.append(m)

    N = div

print(len(res) + 1)

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

    print(cnt)

if __name__ == "__main__":
    resolve()

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

count = 0
while N >= 1:
	N = N / K
	count += 1

print(count)

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

def division(x):
  if x<1:
    return 0
  x = x/k
  ans = 1
  return ans + division(x)

print(division(n))

Solution (Python):
a = list(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 = a[0]
x2 = Base_10_to_n(x10, a[1])

print(len(str(x2)))

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)

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

c = Base_10_to_n(n, k)

print(len(str(c)))

Solution (Python):
def dec_to_base(num,base):  
    base_num = ""
    while num>0:
        dig = int(num%base)
        if dig<10:
            base_num += str(dig)
        else:
            base_num += chr(ord('A')+dig-10)  
        num //= base

    base_num = base_num[::-1]  
    return base_num

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

Solution (Python):
import math
import itertools
import statistics


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

p = 1
keta = 1
while p <= n:
    p *= k
    keta+=1

print(keta-1)

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

ans = ''
while n > 0:
    ans = str(n % k) + ans
    n //= k
print(len(ans))

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

result = []
while True:
    if n < k:
        result.append(n)
        break
    else:
        t = n % k        
        result.append(t)
        n = n // k

print(len(result))

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

print(c+1)

Solution (Python):
import math

n,k=map(int,input().split())
print(math.ceil(math.log(n,k))  if n>=k else 1)

Solution (Python):
raw_input = input()
l = raw_input.split()
N = int(l[0])
K = int(l[1])
counter = 0

while N >= K:
    N = N // K
    counter = counter+1
else:
    counter = counter + 1
    print(counter)

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())			

ans=0

while True:
	
	if N<(K**ans): break
	
	ans+=1


print(ans)

Solution (Python):

n, k = (int(x) for x in input().split())

ans = ''

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 = Base_10_to_n(n, k)

ans = (len(x2))

print(ans)

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

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

print(len(str(base_cvt(N, n=K))))

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

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

print(len(dec_to_n(N, K)))

Solution (Python):
line = input().split(" ")

N, K = int(line[0]), int(line[1])

ans = 0
while N > 0:
	N //= K
	
	ans += 1

print(ans)

Solution (Python):
def a(X, n):
    if (int(X/n)):
        return a(int(X/n), n)+str(X%n)
    return str(X%n)
N,R=map(int,input().split())
a=len(str(a(N,R)))
print(a)

Solution (Python):

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

for i in range(10000000000000):
    if N <= K ** i - 1:
        break
print(i)

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

Solution (Python):
from sys import stdin
N,K = [int(x) for x in stdin.readline().rstrip().split()]
ans = 0
for k in range(10000000):
    if N < K**k:
        break
    
print(k)

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

Solution (Python):

def solve():
    N, K = map(int, input().split())
    i = 1
    while K**i-1 < N:
        i += 1
    return str(i)

if __name__ == '__main__':
    print(solve())

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


print(len(ans)+1)

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

ans = 0
count = 0

while(True):
  if K**count <= N < K**(count+1):
    ans = count
    break

  count += 1

print(ans+1)

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

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

Solution (Python):
import numpy as np

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


for i in range(N):
    if (K**i <= N) & (K**(i+1) > N):
        ans = i+1
        break
        
print(ans)

Solution (Python):
import math

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

ans = int(math.log(n, k)) + 1
print(ans)

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

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

print(len(ans))

Solution (Python):
import numpy as np

NK=np.array(input().split(),dtype=np.int32)

N=NK[0]
K=NK[1]

count=1
th=K
while(True):
    if(N>=th):
        count+=1
        th=th*K
    else:
        break

print(count)

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

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

res += 1
print(int(res))

Solution (Python):
import socket
import sys

hostnames = ['N551J', 'F551C', 'X553M']
input_file = 'b1.in'
if socket.gethostname() in hostnames:
    sys.stdin = open(input_file)


def read_int_list():
    return list(map(int, input().split()))


def read_int():
    return int(input())


def read_str_list():
    return input().split()


def read_str():
    return input()


def solve():
    n, k = read_int_list()
    res = 0
    while n > 0:
        n //= k
        res += 1
    return res


def main():
    res = solve()
    print(res)


if __name__ == '__main__':
    main()

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

a, b = input().split()
a = int(a)
b = int(b)
c = toStr(a, b)
c = int(c)
count = 0
while(c>0):
    count=count+1
    c=c//10
print(count)

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

Solution (Python):
N,R=map(int,input().split())
count=1
for i in range(1,51):
    if N>=R**i:
        count+=1
print(count)

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

value = N
ans = []

while (value != 0):
    ans.append(value % K) 
    value = int(value // K)

print(len(ans))

Solution (Python):



def chg_ks(x, n):
    if (x // n != 0):
        return chg_ks(x // n, n) + str(x % n)
    else:
        return str(x % n)
    

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


ans = len(chg_ks(n, k))


print(ans)

Solution (Python):
def resolve_b():
    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 = Base_10_to_n(n, k)
    print(len(str(ans)))
resolve_b()

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

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

Solution (Python):

import sys



def solve(N: int, K: int):
    ketamax=K-1
    keta=1
    while(N>ketamax):
        keta+=1
        ketamax=(ketamax+1)*K-1
    print(keta)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    solve(N, K)

if __name__ == '__main__':
    main()

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

import math

q = math.log(n,k)
print(math.floor(q+1))

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

num_of_digits = 1

while N >= K ** num_of_digits:
    num_of_digits += 1

print(num_of_digits)

Solution (Python):
from numpy import log
N,K = list(map(int,input().split()))

print(int(log(N)/log(K)+1))

Solution (Python):


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

def f(x, n):
    if int(x / n):
        return f(int(x / n), n) + str(x % n)
    return str(x % n)

ans = f(N, K)
print(len(ans))

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

Solution (Python):
N,K = map(int,input().split())
Hi = 30
Lo = 0

while Hi-Lo > 1:
    Mid = (Hi+Lo)//2
    if N < K**Mid:
        Hi = Mid
    else:
        Lo = Mid

print(Hi)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	N,K = MI()
	n = N
	ans = 1
	while N >= K:
		N //= K
		ans += 1
	print(ans)


if __name__ == '__main__':
	main()

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

cnt = 0
while 0 < N:
    N = N // K
    cnt += 1

print(cnt)

Solution (Python):
import math

if __name__=="__main__":
    n, k = map(int, input().split())
    log_k_n = math.log10(n)/math.log10(k)
    if math.floor(log_k_n) == math.ceil(log_k_n):
        print(math.ceil(log_k_n) + 1)
    else:
        print(math.ceil(log_k_n))

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 = Base_10_to_n(n,k)

print(len(ans))

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

i = 1
while(N >= K):
	N = N / K
	i += 1

print(i)

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

ans=0

while True:
	
	if N<(K**ans):
		break
	
	if N==(K**ans):
		ans+=1
		break
	
	ans+=1


print(ans)

Solution (Python):
def main():
    from math import log,floor,ceil
    n,k=map(int,input().split())
    x=log(n,k)
    if floor(x)==ceil(x):
      x+=1
    x=ceil(x)
    print(x)
  
if __name__=='__main__':
    main()

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

Solution (Python):
n, k = 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(n, k)
print(len(res))

Solution (Python):
def conv(num,b):
    convStr = "0123456789abcdefghijklmnopqrstuvwxyz"
    if num<b:
        return convStr[num]
    else:
        return conv(num//b,b) + convStr[num%b]

first_line = input().split(" ")

print(len(conv(int(first_line[0]), int(first_line[1]))))

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

digit = 0
k = K
while N:
  r = N % k
  N -= r
  k *= K
  digit += 1

print(digit)

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

Solution (Python):
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, K = map(int, input().split())

    def func(x, n):
        if int(x / n):
            return func(int(x / n), n) + str(x % n)
        return str(x % n)

    print(len(func(N, K)))


main()

Solution (Python):
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

a, b = map(int, input().split())
print("{}".format(len(Base_10_to_n(a,b))))

Solution (Python):
import itertools
import sys

n, k = map(int,input().split())
i = 1
while True:
    if k**i > n:
        print(i)
        break
    else:
        i+=1

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)


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

c = Base_10_to_n(n , k)

print(len(str(c)))

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)



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

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


main()

Solution (Python):

n,k = map(int,input().split())
ans = 1
while True:
    if n >= k**ans: ans += 1
    else: break
print(ans)

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

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

def calculate(n,k):
    m = 0
    while k**m <= n:
        m = m + 1

    return m


result = calculate(n,k)

print(result)