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):
s = input().split()

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

i=1
if N == 1:
  print('1')
while N > K **(i-1):
  if N < K**i:
    print(i)
  elif N == K**i:
    print(i+1)
  i += 1

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

Solution (Python):
n, k = map(int, input().split())
count = 1
for i in range(1, 100):
    if n / (k ** i) >= 1:
        count += 1
    else:
        break

print(count)

Solution (Python):
from math import log
n, k = [int(x) for x in input().split()]
print(int(log(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 = (int(x) for x in input().split())
a = 0
while True:
    if k ** a > n: break
    else: a += 1
if a == 0: a += 1
print(a)

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

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

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)

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

if __name__ == '__main__':
    main()

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

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

print(ans)

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

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

print(ans)

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

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

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

Solution (Python):
import math


def main():
    N, K = map(int, input().split())
    print(math.floor(math.log(N, K)) + 1)


if __name__=="__main__":
    main()

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):
import math
N,K=map(int,input().split())
print(int(math.log(N,K))+1)

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

Solution (Python):







def main():
    N, K = map(int, input().split())

    for i in range(1, 1000000):
        v = K ** i
        if v > N:
            print(i)
            exit()


main()

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())
x = 0
y = []
while N >= K**x:
    y.append(x)
    x += 1
h = int(y[len(y)-1]) + 1
print(h)

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

print(len(out))

Solution (Python):
from math import log

n,k = map(int,input().split())
print(int(log(n,k))+1)

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

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

ans = 0

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

print(ans)

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

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

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

print(i)

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

print(ans)

Solution (Python):
from numpy import base_repr

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

print(len(base_repr(N, K)))

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

ans = ''
while N:
    d, m = divmod(N, K)
    ans = str(m) + ans
    N //= K

print(len(ans))

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

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

ans = []
while N != 0:
    ans.append(N%K)
    N = N // K

print(len(ans))

Solution (Python):
import math

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

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

print(digit)

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

result = 0
while N != 0:
    result += 1
    N //= K
print(result)

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

answer = 0

while True:
    answer += 1
    if k**answer>n:
        break

print(answer)

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

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

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
N, K = map(int, input().split())
print(len(Base_10_to_n(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())
ans = 1
tmp = 1

while N >= tmp:
    tmp = tmp * K
    ans += 1


print(ans-1)

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

while shou > 0:
  shou = n // k
  counter += 1
  n = shou

print(counter)

Solution (Python):
n,k=(int(x) for x in input().split())
i = 0
while True:
    kk = k ** i
    if kk > n:
        break
    else:
        i = i + 1

print(i)

Solution (Python):


import math

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

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

print(ans)

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

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

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

ans += 1
print(ans)

Solution (Python):
n , k = map(int, input().split())
count = 0
flag = True
while(flag):
    for p in range(100):
        q = k**p
        if n//q >  0:
            count += 1
        else:
            flag = False
            break
print(count)

Solution (Python):
def int_to_string(n: int, radix: int = 10) -> str:
    """https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString"""

    if radix < 2 or radix > 36:
        raise ValueError("radix must be between 2 and 36")

    char = "0123456789abcdefghijklmnopqrstuvwxyz"
    negative = n < 0
    n = abs(n)
    digits = []

    while n:
        d = n % radix
        n //= radix
        digits.append(d)

    s = "".join([char[d] for d in reversed(digits)])

    if negative:
        return "-" + s

    return s


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

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

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

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


N, K = mi()

import math

ll = math.log(N,K)


print(int(ll)+1)

Solution (Python):
import numpy as np
n,k=map(int,input().split())
print(len(np.base_repr(n,base=k)))

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


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

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

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


for i in range(10000):
    if n//k**i == 0:
        ans=i
        break

print(ans)

Solution (Python):
def ten_to_n(X, n):
    i = X // n
    s = str(X % n)
    if (i):
        return ten_to_n(i, n) + s
    return s

def solve():
    N, M = map(int, input().split())
    n = ten_to_n(N, M)
    return len(n)
 
print(solve())

Solution (Python):
def ten_to_n(X, n):
    i = int(X / n)
    s = str(X % n)
    if (i):
        return ten_to_n(i, n) + s
    return s

def solve():
    N, M = map(int, input().split())
    n = ten_to_n(N, M)
    return len(n)
 
print(solve())

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

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

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

Solution (Python):


import math
I=list(map(int, input().split()))
N=I[0]
K=I[1]
ans=int(math.log(N,K))+1
print(ans)

Solution (Python):


n, k = [int(x) for x in input().rstrip().split(" ")]

k_base_num = []

while True:
  k_base_num.append(n%k)
  n = n//k
  if n == 0:
    break
print(len(k_base_num))

Solution (Python):
import sys

n, k = map(int, sys.stdin.readline().split())

def main():
    cnt = 1
    m = 1
    while m <= n:
        m *= k
        cnt += 1
    return cnt - 1

if __name__ == '__main__':
    ans = main()
    print(ans)

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

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

while n: 
  ans +=1
  amari = n%k
  syou = n//k
  n = syou

print(ans)

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

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())
i = N/K
cnt = 1
while i >= 1:
    i = i/K
    cnt += 1
print(cnt)

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

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

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

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

Solution (Python):


from sys import stdin, stderr

def main():
   N, K = map(int, stdin.readline().split())
   res = 0
   while N > 0:
      res += 1
      N /= K
   print(res)

   return 0

if __name__ == '__main__': main()

Solution (Python):
from math import * 
N, K = list(map(int, input().split()))
print(max(1, ceil(log(N, K))))

Solution (Python):
given, base = [int(x) for x in input().split()]
has = 0
while given > 0:
    has += 1
    given //= base
print(has)

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

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

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

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

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

Solution (Python):
import math

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

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

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


if __name__ == '__main__':
    solve()

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, readline().split()))
    for i in range(10 ** 10):
        if n // pow(k, i) == 0:
            print(i)
            exit()


if __name__ == '__main__':
    solve()

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

count = 0
N_K = 1
while N >= N_K:
    count += 1
    N_K *= K

print(count)

Solution (Python):
n,k = map(int,input().split())
ans = 0
while n>0:
    n//=k
    ans+=1
print(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())
ans = 0
while n:
  n //= k
  ans += 1
print(ans)

Solution (Python):
import math

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

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

Solution (Python):






import math
import statistics
import numpy as np
import queue
import itertools

n,k = map(int, input().split())
p = 1
for i in range(0, 114514):
	if p <= n:
		p *= k
	else:
		print(i)
		break

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


def calc(n, k, cnt):
    if n >= k:
        n = n // k

        return calc(n, k, cnt + 1)
    else:
        print(cnt)


calc(n, k, 1)

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 = ""
while n >= k:
    ans = str(n % k) + ans
    n = int(n / k)
    
ans = str(n) + ans
print(len(ans))

Solution (Python):
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 10**7+9
inf = 10**20

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

n,k = LI()
ans = 0
while n:
    n//=k
    ans+=1
print(ans)

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

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N, K = LI()
ans = 0
tmp = 1
while tmp - 1 < N:
    tmp *= K
    ans += 1

print(ans)

Solution (Python):

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


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

print(answer)

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

Solution (Python):
N,K = map(int, input().split())
 
counter = 1
tmp = 1
while True:
    tmp *= K
    if tmp > N:
        break
    counter += 1
print(counter)

Solution (Python):


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

main()

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

i = []
while N > 0:
  i.append(N%K)
  N = N // K
  
print(len(i))

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

Solution (Python):
str = input().split()
N = int(str[0])
K = int(str[1])
result = N
counta = 0
while True:
	result = result/K
	if(result<1):
		counta+=1
		break
	else:
		counta+=1
print(counta)

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

Solution (Python):
import sys
input = sys.stdin.readline

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

d = 0
while N:
    N //= K
    d += 1

print(d)

Solution (Python):

def main():
    N, K = map(int, input().split())
    digits = 0
    while N:
        N //= K
        digits += 1
    print(digits)


if __name__ == "__main__":
    main()

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

Solution (Python):

n, k = map(int, input().split())
d = 0
while n:
    n = n//k
    d += 1
    if n == 0:
        break
print(d)

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())
x = base_10_to_n(n, k)
print(len(x))

Solution (Python):



from math import *
from copy import *
from string import *				
from random import *				
from sys import stdin
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		
from collections import defaultdict 

'''

'''

def solve(n,k):
	return 1 + floor(log(n,k))
	

N,K = map(int, stdin.readline().rstrip().split())
ans = solve(N,K)
print(ans)

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

ret = 0
while n:
    n //= k
    ret += 1

print(ret)

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

Solution (Python):
import math


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

ans = math.floor(1 + math.log(N)/math.log(K))
print(ans)

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

Solution (Python):
N, K = map(int, input().split())
cnt = 0
while True:
    if N > 0:
        i = N // K
        N = i
        cnt += 1
    else:
        break
print(cnt)

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

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

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

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

Solution (Python):
N, K = map(int, input().split())
digit_str = ''
keta = N
while True:
    keta, amari = keta//K, str(keta%K)
    if keta==0:
        digit_str = digit_str + amari
        break
    digit_str = digit_str + amari

print(len(digit_str))

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

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

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

Solution (Python):
import numpy as np
n, k = map(int, input().split())


def log(r, d):
    return np.log(d)/np.log(r)


def ceil(x):
    if x.is_integer():
        return int(x) + 1
    return int(np.ceil(x))


print(ceil(log(k, n)))

Solution (Python):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def MI(): return map(int, input().split())


def S(): return input()


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False



def conv(x, n):
    if x < 0:
        return None
    if n < 2 or 16 < n:
        return None

    if x == 0:
        return 0

    nchar = '0123456789ABCDEF'
    result = ''

    while x > 0:
        result = nchar[x % n] + result
        x = x // n

    return result


def main():
    N, K = MI()
    print(len(conv(N, K)))


if __name__ == '__main__':
    main()

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

Solution (Python):
from math import log, ceil

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

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

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

Solution (Python):

import sys


def solve(N: int, K: int):
    ans = 0
    while N:
        N, mod = divmod(N, K)
        
        ans += 1

    print(ans)
    
    



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):
import math as m
n,k = map(int,input().split())
print(m.ceil(m.log(n,k)) if n-1 else 1)

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

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

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())
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())
c = 0
while n >0:
    n =n//k
    c += 1
print(c)

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

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


if __name__ == '__main__':
    main()

Solution (Python):
def solve():
    N, K = map(int, input().split())
    
    ans = 0
    while N > 0:
        N = N // K
        ans += 1
    
    print(ans)
    
if __name__ == '__main__':
    solve()

Solution (Python):
def keta(n, k):
    cnt = 0
    while(n != 0):
        n //= k
        cnt += 1
    return cnt


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

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


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

print(c)

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

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

Solution (Python):
def keta(n,k):
    cnt=0
    while(n!=0):
        n//=k
        cnt+=1
    return cnt

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

Solution (Python):
n,k=map(int,input().split())
import numpy as np
ans=len(np.base_repr(n,k))
print(ans)

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

Solution (Python):
import sys
input = sys.stdin.buffer.readline

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

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

print(ans)

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

ans=1
x=n
while x//r>=1:
    x=x//r
    ans+=1
    
print(ans)

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

count = 0

while N != 0:
  N = N // K
  count += 1
  
print(count)

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

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

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip() 
import math
 
def resolve():
    N, K = map(int, input().split())
    print(math.floor(math.log(N, K))+1)
 
if __name__ == '__main__':
    resolve()

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

print(cnt)

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

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=list(map(int,input().split()))
print(len(Base_10_to_n(N,K)))

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

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

Solution (Python):
import sys

input = sys.stdin.readline

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):
import fractions
import collections
from collections import deque
import math
import itertools

N,K=map(int,input().split())
i=1
P=K
while(P<=N):
    i=i+1
    P=P*K
else:
    print(i)

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

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

print(ans)

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

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

print(ans)

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

Solution (Python):
n,k=map(int,input().split());print(sum(n>=k**i for i in range(100)))

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

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

Solution (Python):


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

ans=0
while n>0:
    n = n//m
    ans+=1
    
print(ans)

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

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

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

Solution (Python):
N,K = map(int,input().split())
li = []
while True:
    li.insert(0, N % K)
    N = int(N/K)
    if N == 0:
        break

print(len(li))

Solution (Python):
n,k=map(int,input().split());print(sum(n>=k**i for i in range(100)))

Solution (Python):
N , K  =map(int, input().split())
def nbin(target):
  amari = []

  while target !=0:
    amari.append(target % K)
    target = target // K
  return amari
print(len(nbin(N)))

Solution (Python):
n, k = map(int, input().split())
 
binary = "" 
i = 0
if k == 10:
  print(len(str(n)))
else:
  while n:
    n, r = divmod(n, k)
    binary = binary + str(r)
  print(len(binary))

Solution (Python):
n,k=map(int,input().split());print(sum(n>=k**i for i in range(1,100))+1)

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

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

d = 1
C = K
while N >= C:
    d += 1
    C *= K
print(d)

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

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] = list(map(int,input().split()))
if N<K:
    print(1)
else:
    i=N
    j=0
    while i>=K:
        i = i/K
        j=j+1
    print(j+1)

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

N = inpt[0]
K = inpt[1]

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()); a=0
while n: n//=k; a+=1
print(a)

Solution (Python):


number = input().split(" ")
N = int(number[0])
K = int(number[1])
ans = 0
while N > 0:
    n = N % K
    N = N // K
    ans += 1
print(ans)

Solution (Python):
def reduce_num(x, y):
  if x>=y:
    string_num.insert(0, x%y)
    reduce_num(x//y, y)
  else:
    string_num.insert(0, x)

N, K = map(int, input().split())
string_num = []
reduce_num(N, K)
print(len(string_num))

Solution (Python):
import math
N,K = map(int,input().split())
start = K**int(math.log(N,K))
X = []
while start !=0:
    if N - start >= 0:
        N = N-start
        X.append(1)
    else:
        X.append(0)
    start = int(start / K)
print(len(X))

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

Solution (Python):
def x_base(n, x):
  j = []
  while(1):
    if(n < x):
      j.append(n)
      break
    else:
      j.append(n % x)
      n //= x
  return j


n = [int(i) for i in input().split()]
print(len(x_base(n[0], n[1])))

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

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

Solution (Python):
input = input()

arr = input.split(" ")
N = int(arr[0])
K = int(arr[1])

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

R = Base_10_to_n(N, K)

print(len(str(R)))

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

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

print(len(f_10_to_n(N, K)))

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
    
def main():
    N,K=map(int,input().split())
    print(len(Base_10_to_n(N,K)))
main()

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

i = 1
s = 1
d = 0

while s > 0:
  s = N // i

  i = i * K

  d += 1


if s == 0:
  d -= 1

print(d)

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

e = 0
for i in range (1000):
    if (n / (k ** (i+1))) >= 1:
        e = e + 1
    else:
        e = e

f = e + 1

print (f)

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

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

Solution (Python):
s=input("")
l=s.split()
N=int(l[0])
K=int(l[1])
for i in range(10000):
    if N>=K**i and N<K**(i+1):
        print(i+1)

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

binary = "" 
i = 0
if k == 10:
  print(len(str(n)))
else:
  while n:
    n, r = divmod(n, k)
    binary = binary + str(r)
  print(len(binary))