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(1000):
    if k**i<=n<k**(i+1):
        print(i+1)
        exit()

Solution (Python):
import math

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

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

Solution (Python):
import sys

def main():

    

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

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

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

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

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

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

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

print(len(base_to_n(n,k)))

Solution (Python):
n,k = map(int, input().split())
y = []
while n>=1:
    y.append(n%k)
    n = int(n/k)
y.reverse()
print(len(y))

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

n = input[0]
baseK = input[1]





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

print(count)

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

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

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

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

print(ans)

Solution (Python):
from collections import deque, Counter
from itertools import chain, combinations
import json
import numpy as np
import bisect


def main():
    
    N, K = [int(a) for a in input().split()]

    for i in range(10000000):
        if N < K ** i:
            print(i)
            return

    
    
    
    
    


if __name__ == "__main__":
    main()

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


def main():
    n, k = map(int, input().split())
    res = solve(n, k)
    print(res)


def test():
    assert solve(11, 2) == 4
    assert solve(1010101, 10) == 7
    assert solve(314159265, 3) == 18


if __name__ == "__main__":
    test()
    main()

Solution (Python):
inputNumber, baseNumber = list(map(int,input().split()))
count = 0

if baseNumber == 10:
    print(len(str(inputNumber)))
else:
    while not inputNumber == 0:
        inputNumber = inputNumber // baseNumber
        count += 1
    
    print(count)

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

ans = 0

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

print(ans)

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

ans = ""
while True:
    q, mod = divmod(N, K)
    ans = str(mod) + ans
    if q == 0:
        break
    N = q
print(len(ans))

Solution (Python):
x=input().split()
N=int(x[0])
D=int(x[1])
for k in range(31):
  if N//D**k==0:
    print(k)
    break

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

import math
a = (int(math.ceil(math.log(n)/math.log(k) )))
if a==0:
  print(1)
else:
  print(a)

Solution (Python):
def Digits(N, K):
  if not N:
    return 1
  digits = 0
  while N:
    N = N // K
    digits += 1
  return digits
 
N, K = map(int, input().split())
print (Digits(N, K))

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
def inputS(): return input().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

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

ans = 0

while N:
  ans += 1
  N //= K
print(ans)

Solution (Python):
n, k=map(int, input().split())
box = []
a = n
b = n
while a>0:
    a, b = divmod(a,k)
    box.append(b)


l = len(box)
print(l)

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

Solution (Python):
import math
def main():
    N, K = map(int, input().split())
    digit = 0
    while N != 0:
        k = N % K
        n = int(N/K)
        N = n
        digit+=1

    print(digit)

if __name__ == '__main__':
    main()

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


cnt=0

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

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

Solution (Python):
def convert(t:int,k:int) -> str:
    ans = []
    if t == 0:
        return ans
    while(t >= k):
        ans.append(str(t%k))
        t = t//k
    ans.append(str(t))
    return "".join(ans[::-1])

n,k = map(int,input().split())
s = convert(n,k)
print(len(s))

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

"""
10進数をn進数に変換するには
10進数で表された数値をnで割り
それのあまりを逆から並べると、答えになる
今回は、ただ何回割れるかを出せばいいだけ
"""

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

Solution (Python):
import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(11, 2), 4)

    def test_2(self):
        self.assertEqual(think(1010101, 10), 7)

    def test_3(self):
        self.assertEqual(think(314159265, 3), 18)


def solve():
    n, k = read()
    result = think(n, k)
    write(result)


def read():
    return read_int(2)


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(n, k):
    buf = ''
    while n > 0:
        buf += str(n % k)
        n //= k
    return len(buf)


def write(result):
    print(result)


if __name__ == '__main__':
    
    solve()

Solution (Python):
a,b=map(int,input().split())
ans=0
while 1:
  if a==0:
    break
  a//=b
  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):
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


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

    print(a)
    return


if __name__ == '__main__':
    main()

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

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

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

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

cnt=0


while a>=b:
            a=a//b
            cnt+=1
            
print(cnt+1)

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

print(n)

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

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

print(c)

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

Solution (Python):
tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])
c = 0
while N!=0:
  N = int(N/K)
  c += 1
print(c)

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

ans = 1

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

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

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

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

Solution (Python):
N,K=map(int,input().split())
p=0
for i in range(N):
    p+=1
    N=N//K
    if N==0:
        break
print(p)

Solution (Python):
N, K = list(map(int, input().split()))
d = []
while N > 0:
    d.append(N % K)
    N = N // K

print(len(d))

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

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

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

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

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

i = 1

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

print(i)

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

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

Solution (Python):
N, K = list(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)

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

Solution (Python):
N, K = map(int,input().split())
x = True
s = 1
while x:
   if K ** s > N:
       x = False
   else:
       s += 1
print(s)

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

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

print(ans)

Solution (Python):
import math

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

Solution (Python):
import sys
l = sys.stdin.readline()
n, k = map(int, l.split())
if n == 0:
  print(1)
  sys.exit(0)
count = 0
while n > 0:
    n //= k
    count += 1
print(count)

Solution (Python):
N, K = map(int,input().split())
x = True
s = 1
while x:
   if K ** s > N:
       x = False
   else:
       s += 1
print(s)

Solution (Python):
import sys
input = sys.stdin.readline
def solve():
  n,k = (int(i) for i in input().split())
  digit = 0
  while n>0:
    n //= k
    digit += 1
  print(digit)
solve()

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

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

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

while 1:
    if comp > n:
        break
    r += 1
    comp = k ** r

print(r)

Solution (Python):
import math

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

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

Solution (Python):
def t2n(n, b):
    if int(n/b):
        return (t2n(int(n/b), b) + str(n%b))
    return str(n%b)
N,R =[int(i) for i in input().split()]
print(len(t2n(N,R)))

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())
x=0
while K**x<=N:
    x=x+1
print(x)

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

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

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

print(ans)

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())
ans = 0
while n >  0:
  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 to_n(n,k):
    count =0
    while n!=0:
        n = n // k
        count+=1
    return count
print(to_n(n,k))

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

if __name__ == '__main__':
	main()

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

i=0
while(True):
  if N/(K**i) >= 1:
    i += 1
  else:
    break;

print(i)

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

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

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

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

Solution (Python):
n,m = map(int,input().split())
ct = 0

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

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
  
i = list(map(int, input().split()))
out = Base_10_to_n(i[0], i[1])
print(len(str(out)))

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

i = 0
while True:
    if K ** i > N:
        break
    i += 1

print(i)

Solution (Python):
n,k=map(int,input().split())
count=1
num=n
while True:
    if num<k:
      print(count)
      exit()
    else:
      num=num/k
      count+=1

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

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

    print(cnt)


if __name__ == "__main__":
    main()

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

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

Solution (Python):
n, k = (int(z) for z in 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 = n // k
    ans += 1
print(ans)

Solution (Python):
import math


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


if __name__ == "__main__":
    main()

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

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

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())
d = k
ans = 1
while True:
    if k > n:
        break
    ans += 1
    k *= d
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())
cnt = 0

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

if N >= 1:
    cnt += 1

print(cnt)

Solution (Python):
def base_10_to_n(x, n):
    tmp = x
    res = ''
    while tmp > 0:
        res = str(tmp % n)+res
        tmp = int(tmp/n)
    return res


n, k = map(int, input().split())
print(len(str(base_10_to_n(n, k))))

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


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


def read_index():
    return map(lambda x: x - 1, map(int, input().split()))


def read_list():
    return list(read_values())


def read_lists(N):
    return [read_list() for n in range(N)]


def main():
    import math
    N, K = read_values()
    d = math.log(N, K)
    print(math.floor(d) + 1)


if __name__ == "__main__":
    main()

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

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


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


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


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


def read_str():
    return input()


def main():
    N, K = read_int_list()
    res = 0
    while N > 0:
      N //= K
      res += 1
    print(res)

main()

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

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

print(ans)

Solution (Python):
[N, K] = list(map(int, input().split()))
i = N // K
k = []
k.append(N%K)
while i != 0:
  i = i // K
  k.append(i % K)
print(len(k))

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)


s = Base_10_to_n(N,K)
print(len(s))

Solution (Python):
n,k = [int(i) for i 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)


m = Base_10_to_n(n,k)


print(len(m))

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):
inp = list(map(int, input().split()))
n = inp[0]
k = inp[1]
for i in range(50):
    if(k ** i > n):
        print(i)
        break

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

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

while n > 0:
    n //= k
    if n == 0:
        break
    else:
        count += 1

print(count)

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):
n,b = input().split()
n = int(n)
b = int(b)

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

a = len(base10to(n,b))
print(a)

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

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

def toN(n, k):
    if (int(n/k)):
        return toN(int(n/k), k)+str(n%k)
    return str(n%k)

print len(str(toN(n, k)))

Solution (Python):

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

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


keta = 0
while True:
    N = N // K 
    keta += 1
    if N == 0:
        break

print(keta)

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

res = 0
M = N
while M >= 1:
    M /= K
    res += 1
print(res)

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

Solution (Python):
n, r = map(int, input().split())
i = r
c = 1
while i <= n:
	i *= r
	c += 1
print(c)

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

Solution (Python):
N, K = map(int,input().split())
def func(x):
  if 0 <= x < K:
    return 1
  else:
    return 1 + func(x // K)

print(func(N))

Solution (Python):
n,k=map(int,input().split())
l=[]
if k<=9 :
  while True:
    a=n%k
    if n>=k:
      l.append(a)
    n//=k
    if n<k :
      l.append(n)
      break
  print(len(l))
else:
  print(len(str(n)))

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

Solution (Python):
import math

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

x = 0
while True:
    if N < math.pow(K, x):
        print(x)
        break
    x += 1

Solution (Python):
from sys import stdin
n,k = map(int,stdin.readline().rstrip().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):
n,k = map(int,input().split())
cnt = 0
while True:
    if n < k and n%k == 0:
        break
    cnt += 1
    n //= k
print(cnt)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

























def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')

def main():
	N,K = inputMap()
	ans = 1

	while True:
		tmp = N // K
		if tmp == 0:
			break
		N = tmp
		ans += 1

	print(ans)


if __name__ == "__main__":
	main()

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

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

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

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

print(count)

Solution (Python):

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



dm = [n,0]
ha = ''

while dm[0] > 0:
	dm = divmod(dm[0],k)
	ha += str(dm[1])


print(len(ha))

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

while n > 0:
  re = re + 1
  n = n // r
print (re)

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

Solution (Python):
import sys

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

if __name__ == "__main__":
    resolve()

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

while i <= 100000000:
  if N < K ** i:
    print(i)
    break
    
  else:
    i += 1

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

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

print(len(str(Base_10_to_n(N, K))))

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

keta = 0
a = N
while True:
    a = a // K
    keta = keta + 1
    if a == 0:
        break

print(keta)

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

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

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

c = 0
n = N

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

print(c)

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

ans = ""
while True:
    n, m = divmod(n, k)
    ans += str(m)
    if n == 0:
        break
print(len(ans))

Solution (Python):
if __name__ == '__main__':

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

    q = n
    s = []
    while True:        
        s.append(q % k)
        q = q // k
        if q == 0:
            break
    
    print(len(s))

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

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

S = ""
while 1:
    S += str(N % K)
    N //= K
    if N == 0:
        break
print(len(S))

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

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

Solution (Python):
a, b = input().split()
a, b = int(a), int(b)
 
digit = 0
for i in range(100):
  if a <= b ** i - 1:
    digit = i
    break
    
print(digit)

Solution (Python):
inp = input().split()
n = int(inp[0])
k = int(inp[1])
count = 1
w = k
while ((n//w) > 0):
    w = w * k
    count += 1
print(count)

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

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

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

ans = 1

while n >= k ** ans:
    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())
ans = ''
while N >= K:
    ans = str(N % K) + ans
    N  = N // K
ans = str(N) + ans
print(len(ans))

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

Solution (Python):
import math

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

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

Solution (Python):
import math

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

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

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())
x = Base_10_to_n(N,K)
print(len(x))

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

while n//k**i != 0:
    i += 1

print(i)

Solution (Python):
import math


def main(n, k):
    print(math.floor(math.log(n, k) + 1))


if __name__ == "__main__":
    n, k = map(int, input().split())

    main(n, k)

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

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

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):
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines







def main():
	n,k=map(int,input().split())
	
	cnt=0
	
	while True:
		if n==0:
			print(cnt)
			exit(0)
		else:
			n//=k
			cnt+=1
	
	
	
	
	
	
if __name__ == "__main__":
	main()

Solution (Python):
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


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

    i = 1
    r = 0
    while r != N:
        r = N % pow(K, i)
        i += 1

    print(i-1)

if __name__ == "__main__":
    main()

Solution (Python):
N, K = map(int, input().split())
cout = 1
for i in range(N):
    if N<K:
        break
    N = N//K
    cout += 1

print(cout)

Solution (Python):
from math import log, ceil
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


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

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


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
a = input().split()
x = int(a[0])
y = int(a[1])
z = int(x/y)
n = 1
while z>=1:
        z = int(z/y)
        n = n+1
print(n)

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

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())
from math import log as log
keta = log(n, k) + 1
print(int(keta))

Solution (Python):
a=input().split()
N = int(a[0])
K = int(a[1])
N = int(N / K)
cnt = 1
while N > 0:
    N = int(N / K)
    cnt += 1
print(cnt)

Solution (Python):

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)



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


def II():
    return int(input())

directions=np.array([[1,0],[0,1],[-1,0],[0,-1]])
directions = list(map(np.array, directions))

mod = 10**9+7


def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact



def serch(x, count):
    
            

    for d in directions:
        nx = d+x
        
        if np.all(0 <= nx) and np.all(nx < (H, W)):
            if field[nx[0]][nx[1]] == "E":
                count += 1 
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)  
                continue
            if field[nx[0]][nx[1]] == "
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)    
                 
    return count


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=acinput()
s=Base_10_to_n(N,K)
print(len(s))

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

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(str(base_10_to_n(n, k))))

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

keta=1
while s[0]>=s[1]:
    s[0]=s[0]/s[1]
    keta+=1

print(keta)

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

Solution (Python):
from sys import stdin

x = [int(x) for x in stdin.readline().rstrip().split()]

N = x[0]
K = x[1]

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


print(ans)

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

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

print(ans)

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

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

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

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

total = 0

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

print(total)

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

Solution (Python):
def div(v, d):
  if v < d:
    return 1
  return 1 + div(v/d, d)

l = list(map(int, input().split()))
print(div(l[0], l[1]))

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

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

print(len(Base_10_to_n(N, K)))

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

while x != 0:
    n = x
    x = n//k
    count += 1

print(count+1)

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

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

while 1:
    if n < k:
        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=list(map(int,input().split()))
count=0

while n/k!=0.0:
  n=n//k
  count+=1

print(count)

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

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

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

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

Solution (Python):
import sys
import sys
sys.setrecursionlimit(1000000)


def input():
    return sys.stdin.readline()[:-1]

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

def main():
    N,K = map(int, input().split())
    print(len(fun(N, K)))
    
if __name__ == "__main__":
    main()

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

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