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

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

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




if __name__ == '__main__' :
    main()

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 = [int(_) for _ in input().split()]

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

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

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
keta = 1

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

print(ans)

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

Solution (Python):


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

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

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


f=False
p=0
while f==False:
    if N/(K**p) < 1:
        f=True
        p-=1
    p+=1
print(p)

Solution (Python):

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

m = 1
n = int(n/k)
while n > 0:
    m += 1
    n = int(n/k)

print(m)

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, K):
    print(len(str(base10to(N, K))))

if __name__ == '__main__':
    N, K = map(int, sys.stdin.readline().strip().split(" "))
    solve(N, K)

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

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

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

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

count = 0
while True:
    count += 1
    if n < k:
        break
    n = n / k

print(count)

Solution (Python):
n,k = map(int,input().split())
ans = 0
for i in range(10**9):
    if n >=k:
        n = n//k
        ans +=1
    else:
        break
print(ans+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 = input().split()
print(len(Base_10_to_n(int(N), int(K))))

Solution (Python):
time_line = input().rstrip().split(" ")
time_a = int(time_line[0])
time_b = int(time_line[1])
keta=0


while(time_a>time_b-1):
    time_a=time_a//time_b
    keta+=1


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

xn = Base_10_to_n(n, k)
print( len(str(xn)) )

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

ans = 1
while True:
    if n <= k**ans - 1:
        print(ans)
        break
    ans += 1

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

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

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

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

for i in range(n):
    tmp = tmp * k
    if n < tmp:
        print(i + 1)
        break

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

i = 0

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

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

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

result = 0
for i in range(100000):
    if k**i > n:
        break
    else:
        result += 1
print(result)

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):
s = input().split()
N = int(s[0])
K = int(s[1])

for i in range(10000):
    if K**i <= N and N < K**(i+1):
        ans = i+1
        break

print(ans)

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

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

print(len(str(convert(n,r))))

Solution (Python):









import os
import sys
import numpy as np


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



if __name__ == "__main__":
    main()

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

print(len(result))

Solution (Python):



n,k = input().rstrip().split(' ')

n = int(n)
k = int(k)
K = k
count = 1

while(1):
    if K > n:
        print(count)
        break
    K = K*k
    count += 1

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

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

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

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

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

print(count+1)

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

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)


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

Solution (Python):
import math

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

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

print(result)

Solution (Python):
n,k=map(int,input().split())
list=[]
for i in range(n+2):
    c=n//k
    d=n%k
    n=c
    if c==0:
        e=1
        break
    if c < k:
        e=i+2
        break
print(e)

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    vn = vk = vn_k = 1
    for i in range(1, n+1):
        vn = vn * i % modp
        if i == k:
            vk = vn
        if i == n-k:
            vn_k = vn
    return vn * get_inv(vk, modp) * get_inv(vn_k, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp



def main():
    N,K=mis()
    import numpy as np
    print(len(str(np.base_repr(N,K))))

main()

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

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

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

a=0
b=0
c=0
if N<K:
        c+=1
        print(c)
        exit()
for _ in range(36): 
    a=N//K
    b=N%K
    N=a
    c+=1
    if a<K:
        c+=1
        print(c)
        exit()

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

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

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


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

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):
a,b=map(int,input().split())
c=0
s=''
if b>a:
    print(1)
else:
    while a>=1:
        s+=str(a%b)
        a//=b
        c+=1
    print(len(s))

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

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

N, K = list(map(int, input().split()))
x = change(N, K)
print(len(x))

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

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

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

Solution (Python):


import math

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

total = 0
while math.floor(n / k) != 0:
    total += 1
    n = math.floor(n / k)

print(total + 1)

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

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

Solution (Python):

N, K = 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)

ans = base10to(N, K)
ans = str(ans)
print(len(ans))

Solution (Python):
import math

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

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

s=N
a=0
ans=""
while s!=0:
    N=s
    s = N//K
    a = N%K
    ans += str(a)

print(len(ans))

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

Solution (Python):


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

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

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

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

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

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

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

for i in range(100):
  if n<r**i:
    print(i)
    break

Solution (Python):
def main():
    n,k = map(int,input().split())
    bi = ''
    while n != 0:
        bi += str(n % abs(k))
        if k < 0:
            n = -(-n // k)
        else:
            n = n // k
    bilast = bi[::-1]
    print(len(bilast))

if __name__ == '__main__':
    main()

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

Solution (Python):
from math import log, ceil, floor
N, K = [int(n) for n in input().split()]
print(floor(log(N,K))+1)

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

ans = 0
t = k**(ans)
while n >= t:
  ans += 1
  t=k**(ans)
if n == 0:
  print(1)
else:
  print(ans)

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

def base(a, b):
  if (int(a/b)): return base(int(a/b), b) + str(a % b)
  return str(a % b)

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

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

ans = 0
while x >= 1:
    x /= 10
    ans += 1
print(ans)

Solution (Python):

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

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

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

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

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

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

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

Solution (Python):
i = list(map(int,input().split()))
count=1
while i[0]>=i[1]:
  i[0]=i[0]//i[1]
  count=count+1
print(count)

Solution (Python):





def solv(N, K):
    ans = 1
    while N >= K:
        N = N // K
        ans += 1
    return ans


if __name__ == "__main__":

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

    print(ans)

Solution (Python):



def main():
    def digit(x, n):
        x_tmp = x
        res = ''
        while x_tmp > 0:
            res += str(x_tmp % n)
            x_tmp = int(x_tmp/n)
        return len(res)

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

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

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

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,r=map(int,input().split())
x2 = Base_10_to_n(n, r)
print( len(x2) )

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 = list(map(int, input().split()))

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

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

Solution (Python):
import sys
from io import StringIO
import unittest

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

    c=1
    s=k
    while 1:
        if s>n:
            print(c)
            return
        s*=k
        c+=1

    return

resolve()

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

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

N = (int)(N)
K = (int)(K)

ans=""

while(N >= K):
    ans += str(N%K)
    N = N//K
ans += (str)(N)

print(len(ans))

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

ans = 1


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

Solution (Python):
inp = [int(i) for i in input().split()]
N = inp[0]
K = inp[1]
n = N
c = 0
while n>=1:
  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):
x,y = map(int,input().split())

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

x2 = Base_10_to_n(x, y)
print(len(str(x2)))

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

power = 0
while(True):
    if K**power > N:
        break
    power += 1

print(power)

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

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

c = 1
while True:
    n = n// k
    if n == 0:
        break
    else:
        c += 1
        
print(c)

Solution (Python):


stdin = open(0)


N, K = map(int, stdin.read().split())



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


print(digits)

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

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

print(len(result))

Solution (Python):

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

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

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

Solution (Python):

N,K = map(int,input().split())
amari = []
while N != 0:
    amari.append(N%K)
    N = N // K
amari.reverse()
print(len(amari))

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

Solution (Python):


n, k = map(int, input().split())
k0 = k
r = 1
fl = True
while k <= n:
    k *= k0
    r += 1

print(r)

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)

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

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

Solution (Python):
def main():
    n, k = map(int,input().split()) 
    ret = 1

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

    print(ret)


if __name__ == "__main__":
    main()

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

ans = 1

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

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

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

target = Base_10_to_n(a, b)

ans = list(target)

print(len(target))

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)

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

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

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

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

print(keta)

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

ans=""
for i in range(100):
    ans+=str(N//(K**(99-i)))
    N%=(K**(99-i))
ans=int(ans)
ans=str(ans)
print(len(ans))

Solution (Python):

"""
Created on Sat Feb 22 20:52:04 2020

@author: H_Hoshigi
"""

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

keta = 0
n = N
while n>=1:
    keta += 1
    n = n//K

print(keta)

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)

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

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

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

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

print(i)

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


if N < K:
    print(1)
    exit()

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

print(cnt)

Solution (Python):
import math

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

ans=math.floor(math.log(N,K))

print(ans+1)

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

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

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

Solution (Python):
s=list(map(int,input().split()))
def sin(X,n):
    a=X
    out=''
    while a>0:
        out=str(a%n)+out
        a=int(a/n)
    return out
b=sin(s[0],s[1])
print(len(b))

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

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

Solution (Python):
import sys
from collections import deque

def _ia(): return [int(x) for x in sys.stdin.readline().strip().split()]


n, k = _ia()
c = 0
while n>0:
   m = n%k
   n = (n-m)//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):
N,K = map(int,input().split())

keta = 1
for i in range(1,1000):
    if N//K**i > 0:
        keta += 1
        
print(keta)

Solution (Python):
def solve(N, K):
    ans = 0
    if N == 0:
        return 1

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

if __name__ == "__main__":
    N, K = tuple(map(int, input().split(" ")))
    print(solve(N, K))

Solution (Python):
n,k = map(int,input().split())
b = ""
while n != 0:
    b += str(n%k)
    n //= k
print(len(b))

Solution (Python):
N,K = map(int,input().split())
count = 1
for k in range(1000000):
    if N / K >= 1:
        count += 1
        N = N / K
    else:
        break

print(count)

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

Solution (Python):
if __name__ == '__main__':
    n, k = map(int, input().split())
    count = 0

    while n > 0:
        count = count +1

        if n - k ** count < 0:
            break

    print(count)

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

print(1 if N == 1 else math.ceil(math.log(N,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)

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

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

for i in range(1,100):
    r*=k
    if r>n:
        print(i)
        exit()

Solution (Python):


import math
import sys



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

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

Solution (Python):
A = list(map(int,input().split(" ")))
num_list = ""
n = A[1]
number = A[0]
while number != 0:
    num_list += str(number % n)
    number = number // n
print(len(num_list))

Solution (Python):
import string
numbers = "0123456789"
alphabets = string.ascii_letters
characters = numbers + alphabets
n, k = map(int, input().split())

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

m = base_cvt(n, k)

print(len(str(m)))

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

count = 0

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

print(count)

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

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007



def main():
	n, k = IN()
	
	i=1
	while n > (k**i)-1:
		
		i+=1
	ret = i
	print(ret)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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


def number_to_base(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return digits[::-1]


print(len(number_to_base(n, k)))

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()

left = 0
right = 100
while right > left + 1:
    mid = (left + right) // 2
    if N < K ** mid:
        right = mid
    else:
        left = mid

print(right)

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 = (int(x) for x in input().split())
xk = Base_10_to_n(n, k)

print(len(str(xk)))

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

def convert(n, base):
    result=""

    while n > 0:
        result = str(n % base) + result
        n //= base
    return result
    
print(len(convert(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)
xx = str(x)
print(len(xx))

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

for i in range(1000000):
  if pow(k, i) - 1 >= n:
    print(i)
    break

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)


answer=Base_10_to_n(N,K)

print(len(str(answer)))

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

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

ans = 1
tmp = 1
for i in range(n):
  if ((k**ans) > n):
    print(ans)
    break
  ans += 1

Solution (Python):
N,K=map(int,input().split())
cnt=0
while N>0:
    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):
n, k = map(int, input().split())

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

print(len(sinsu(n, k)))

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

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

for i in range(1,100):
    if n<k**i:
        print(i)
        break

Solution (Python):
import math

N, K = map(int, input().split())
log = math.log(N,K)
if float.is_integer(log):
    print(math.ceil(log)+1)
else:
    print(math.ceil(log))

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

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

Solution (Python):
import sys
def parse_base10_to_basen(x, n):
    if (int(x/n)):
        return parse_base10_to_basen(int(x/n), n) + str(x%n)
    return str(x%n)

sys.setrecursionlimit(10000)
n, k = map(int, input().split())

a = parse_base10_to_basen(n, k)
print(len(a))

Solution (Python):
import math

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

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

ans = math.log(n, k)




if ans.is_integer():
    print(int(ans+1))
else:
    print(math.ceil(ans))

Solution (Python):
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True 
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,k = inm()
for i in range(40):
    if k**i>n:
        print(i)
        exit()

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

ans = 0

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

print(ans)

Solution (Python):
def read():
    N, K = list(map(int, input().strip().split()))
    return N, K

def solve(N, K):
    count = 0
    while N > 0:
        N //= K
        count += 1
    return count


if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))

Solution (Python):
import math
n,k=map(int, input().split())
m=math.ceil(math.sqrt(n))+1
ans=0
for i in range(m):
    if n>=k**i:
        ans+=1
    else:
        break
print(ans)

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

dig=0

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

print(dig)

Solution (Python):
n, r = map(int, input().split())
for i in range(1, 10**100):
  if r ** (i - 1) <= n < r ** i:
    print(i)
    exit()

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)

 
 


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

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

def ntok(X, N):
    if (int(X / N)):
        return ntok(int(X / N), N) + str(X % N)
    return str(X % N)

print(len(ntok(n, k)))

Solution (Python):

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

n = 0
while True:
    if K ** n <= N:
        n+=1
    else:
        break

print(n)