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

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

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

def resolve():
    N, K = map(int, input().split())
    print(len(str(base_cvt(N, n=K))))

if __name__ == '__main__':
    resolve()

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

num = 1

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

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

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

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

def mainA():
	N,R=map(int,input().split())
	
	
	
	
	if N >= 10:
		res = R
	else:
		res = R + 100*(10-N)
	
	print(res)

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

def mainC():
	
	N=input().rstrip()
	
	vA=list(map(int,input().split()))
	
	res = float("inf")
	for i in range(1, 101):
		t = sum((x-i)**2 for x in vA)
		res = min(res, t)
	
	print(res)



mainB()

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

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

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

Solution (Python):
import math

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

answer = math.floor(math.log(n) / math.log(k)) + 1
print(answer)

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

Solution (Python):
import sys
N,K = map(int,input().split())
K0 = K
if N < K:
    print(1)
    sys.exit()
count = 1
while N>=K:
    K=K*K0
    count += 1

print(count)

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

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

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

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

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

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

result = ''
if N == 0:
    result += str(N)

while( N != 0 ):
    q, mod = divmod(N, K)
    
    result += str(mod)
    N = q


print(len(list(reversed(result))))

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

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

 
 


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

Solution (Python):

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

ans = ''
while N>0:
        ans = str(N%R)+ans
        N = int(N/R)

print(len(ans))

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

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

Solution (Python):

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


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


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

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

    return 0


if __name__ == '__main__':
    main()

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

NN=[]
A=0
while N>=K:
    NN.append(N)
    N=int(N/K)
    A+=1
X=A+1
print(X)

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

Solution (Python):
import numpy as np

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

ans = int(np.log10(n) / np.log10(k)) + 1

print(ans)

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

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

ans = len(str(Base_10_to_n(n,k)))

print(ans)

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

Solution (Python):
import math
def main():
    t = input().split()
    n,k = int(t[0]),int(t[1])
    
    logk = int(math.log(n,k))+1

    print(logk)


if __name__ == "__main__":
    main()

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

def base_cvt(value, n=2):
    tmp=int(value)
    result = ''
    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(base_cvt(str(n),k)))

Solution (Python):
import math

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

while n > k-1:
    n = math.floor(n/k)
    count += 1

print(count)

Solution (Python):
import math
n = input().split()
print((math.floor(math.log(int(n[0])) /
                 math.log(int(n[1]))) + 1))

Solution (Python):
n,k = map(int ,input().split())
am=[]
while True:
    if n==0:
        print(len(am))
        exit()
    else:
        n=n//k
        am.append(n%k)

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

Solution (Python):
data = input()
num = int(data.split()[0])
base = int(data.split()[1])
n=0
while True:
  if base**n <= num:
    n+=1
  else:
    break
    
print(n)

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

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

i = 1
cnt = 0
t = 0
while n > 0:
    t = k**i - 1
    i += 1
    cnt += 1
    if n-t <= 0:
        break

print(cnt)

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

while max <= N:
  max = max * K
  ans  =ans + 1
  
print(ans)

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

Solution (Python):
def base_10_to_n(a, b):
    if (int(a/b)):
        return base_10_to_n(int(a/b), b) + str(a%b)
    return str(a%b)

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

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
import pprint
sys.setrecursionlimit(10 ** 9)


INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007



n, k = LI()
ret = 1
cnt = 0
while ret - 1 < n:
    ret *= k
    cnt += 1


print(cnt)

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

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

Solution (Python):
def main(n, k):
    i = 0

    while n != 0:
        n -= n % (k ** i)
        i += 1

    print(i - 1)


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

    main(n, k)

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

i=0
a=[]
if K==10:
    print(len(str(N)))
else:
    while N>=K**i:
        i+=1
    i-=1
    for j in range(i+1):
        a.append(N//(K**(i-j)))
        N%=(K**(i-j))
        
    print(len(a))

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

d = 0

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

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

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

length = 1

if N == 1:
    print(1)
    exit()

while True:

    N //= K
    length += 1

    if N < K:
        break

print(length)

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

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

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

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 = 1
while 1:
    if n < k:
        print(1)
        break
    if n < k ** i and n > k ** (i - 1):
        print(i)
        break
    if n == k ** i:
        print(i + 1)
        break
    else:
        i = i + 1

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

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

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

b = a[0]
cnt = 1
while b >= a[1]:
    cnt = cnt + 1
    b = b / a[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)

 
 


num, k = input().split()
x2 = Base_10_to_n(int(num), int(k))
print( len(str(x2)) )

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

def ten_to_K(N,K,conv):
  if N // K == 0:
    conv += str(N % K)
    return conv
  else:
    N = N // K
    conv += str(N % K)
    return ten_to_K(N,K,conv)

ans = ten_to_K(N,K,conv)
print(len(ans))

Solution (Python):

import sys


def solve(N: int, K: int):
    ans=[N%K]
    a=N//K
    b=N%K
    if K==2:
        print(len(bin(N))-2)
        exit()
    elif K==8:
        print(len(oct(N))-2)
        exit()
    while True:
        a=a//K
        ans.append(a%K)
        if a==0:
            break
    print(len(ans))
    return



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

if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin

N, K = stdin.readline().rstrip().split()
N = int(N)
K = int(K)

keta = 1

K_ = K
while 1:
	if N < K:
		break
		
	else:

		keta += 1

		K *= K_


	
print(keta)

Solution (Python):
N, K = map(int, input().rstrip().split())
l = []
mod = -1
while N != 0:
    N, mod = divmod(N, K)
    
    l.append(mod)
print(len(l))

Solution (Python):
import sys

f = sys.stdin
N, K = map(int, f.readline().split(' '))

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

print(count)

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

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

for i in range(100):
  if K ** i > N:
    Ans = i
    break

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

Solution (Python):
import math

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

if N == 0:
  result = 1
else:
    result = int((math.log(N, K) + 1) // 1)

print(result)

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

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

print(ans+1)

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

i = 0
ans = 0
while i <= 10**9:
    if N < K:
        ans = 1
        break
    elif N == K:
        ans = 2
        break
    elif K**i > N:
        ans =  i
        break
    else :
         i += 1 
print(ans)

Solution (Python):
import math
 
s = input().split()
n, k = int(s[0]), int(s[1])
 
ans = int(math.log(n, k) + 1.0)
print(ans)

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

i = 1

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

print(i)

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

Solution (Python):




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


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

 
 


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

Solution (Python):
import sys
[N,K] = [int(s) for s in sys.stdin.read().split()] 
a = 0
l = 1
while l != 0:
  if N >= K**a:
    a += 1
  else:
    l = 0
print(a)

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


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


x = base10to(n, k)

print(len(x))

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

out = []
while 1:
  out.append(N%K)
  N = int(N/K)
  if N == 0:
    break
  elif 0 < N <= K-1:
    out.append(K-1)
    break
print(len(out))

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

count=0

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

print(int(count)+1)

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

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

Solution (Python):

import sys
import math

def solve(N: int, K: int):
    print(str(math.floor(math.log(N,K))+1))
    return



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

if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
n, k = map(int, input().split())
if n <= k-1:
    print(1)
else:
    n -= (k-1)
    for s in range(1, 1000000000):
        if n > (k**s)*(k-1):
            n -= (k**s)*(k-1)
        else:
            print(s+1)
            break

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

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

print(cnt+1)

Solution (Python):
import math
import copy
from copy import deepcopy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics
import heapq







def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList




data = getInputListInt()
n = data[0]
k = data[1]

counter = 1
num = k

flg = True
while flg:
    if n > num-1:
        num *= k
        counter += 1
    else:
        flg = False

print(counter)

Solution (Python):
a,b = input().split()
A = int(a)
B = int(b)
import numpy as np
print(len(np.base_repr(A,B)))

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

findNumberOfDigits(int(n), int(k))

Solution (Python):
def main():
    n,k = map(int,input().split())
    temp = n
    answer = ""
    while temp > 0:
        answer = str(temp % k) + answer
        temp = temp // k
    print(len(answer))

if __name__ == '__main__':
    main()

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

findNumberOfDigits(int(n), int(k))

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

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

while N != 0:
    digit.append(N%K)
    N = N//K

print(len(digit))

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

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

Solution (Python):
import string
numbers = "0123456789"
alphabets = string.ascii_letters 
characters = numbers + alphabets

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

def main():
  n,k = map(int,input().split())
  if k==10:
    print(len(str(n)))
  else:
    nbr = base_cvt(str(n), k)
    print(len(str(nbr)))
    
if __name__ == '__main__':
    main()

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

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

Solution (Python):
def main():
    n, k = map(int, input().split(" "))
    smaller = True
    index = 0
    while (smaller):
        index+=1
        smaller = n >= k ** index
    print(index)


if __name__ == "__main__":
    main()

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

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

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

print(len(shinsu(N,K)))

Solution (Python):
import math as m

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

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

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

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

print(ans - 1)

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

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

def b(x,n):
    xd=x
    o=""
    while xd>0:
        o=str(xd%n)+o
        xd=int(xd/n)
    return o
    
print(len(b(n,k)))

Solution (Python):
x,y = map(int,input().split())

count = 0
while y**count <= x:
    count += 1
print(count)

Solution (Python):
from sys import stdin

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 = [int (x) for x in stdin.readline().rstrip().split()]
    result = len(str(N)) if K == 10 else len(Base_10_to_n(N, K)) 
    print(result)


if __name__ == '__main__':
    main()

Solution (Python):


import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (n, k) = [int(e) for e in lines[0].split(" ")]

    return (n, k)


def solve(n, k):

    tmp = math.log(n, k)
    if tmp.is_integer():
        result = math.ceil(tmp) + 1
    else:
        result = math.ceil(tmp)

    return result
    


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

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

i=1
x=K

while x <= N:
  x *= K
  i += 1

print(i)

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

n = int(input[0])

k=  input[1]

ln = len(str(n))
sum =0
i=0
while True :
    i+=1
    
    
    if n % (k**i)== n :
        break
    
    
print(i)

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

Solution (Python):
N,K = map(int, input().split())
c = 1
K_ = 1
i=True
while i==True:
  K_ = K_ *K
  if N < K_:
    print(c)
    i=False
  c += 1

Solution (Python):
def solve():
    N, K = map(int, input().split())
    
    ex = 1
    while K ** ex <= N:
        ex += 1
    print(ex)
    
if __name__ == '__main__':
    solve()

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

N_nketa = (int(N_n)+1)

print(N_nketa)

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

mod = 100
count = 0
while n > 0:
    n, mod = divmod(n,k)
    count += 1

print(count)

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

Solution (Python):
N,R = input().split()
i = int(N)
j = 0

while i // int(R) > 0:
    j += 1
    i = i // int(R)
print(j+1)

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

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

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

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

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


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

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

if K == 2:
    ans = len('{:b}'.format(N))
elif K == 8:
    ans = len('{:o}'.format(N))
elif K == 10:
    ans = len(str(N))
else:
    nn = N
    out = ''
    while nn>0:
        out = str(nn%K)+out
        nn = int(nn/K)
    ans = len(out)



print(ans)

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

ans = []
while True:
    q, mod = divmod(n, k)
    ans.append(mod)
    n = q
    if n == 0:
        break


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

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

Solution (Python):
N, K = [int(n) for n in input().split()]
ans = []
while 0<N:
    N, m = divmod(N, K)
    ans.append(m)
print(len(ans))

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

def base(n, b):
    k = 97 + abs(b - 10)
    dic= {}
    k2 = ""
    k3 = 10
    for i in range(97, k +1):
        dic[k3] = chr(i)
        k3 +=1
    while n>=b:
        mod= int(n%b)
        n = int(n//b)
        if mod in dic.keys():
            k2 += dic[mod]
            continue
        k2 += str(mod)
    k2 += dic[n] if n in dic.keys() else str(n)
    return k2[::-1]
print(len(base(n, k)))

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

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

Solution (Python):
list = list(map(int, input().split()))
original = list[0]
n = list[1]
x = 0
ans = 0

if original//n != 0:
  x = original//n
  ans += 2
  while x//n != 0:
    x = x // n
    ans += 1
  print(ans)
else:
  print(1)

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

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N,K = inpl()
ans = 0
while K**ans <= N:
    ans += 1

print(ans)

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

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

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

     return str(X%n)

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

print(len(Base10_n(p, k)))

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

Solution (Python):


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

for i in range(35, -1, -1):
    if n >= k**i:
        result = i+1
        break
print(result)

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

temp=1
for i in range(10**5):
    temp*=k
    if(temp>n):
        print(i+1)
        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)

print(len(base_10_to_n(N,K)))

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

solve()

Solution (Python):
import string
n,k = map(int, input().split())
digs = string.digits + string.ascii_letters


def int2base(x, base):
    if x < 0:
        sign = -1
    elif x == 0:
        return digs[0]
    else:
        sign = 1

    x *= sign
    digits = []

    while x:
        digits.append(digs[int(x % base)])
        x = int(x / base)

    if sign < 0:
        digits.append('-')

    digits.reverse()

    return ''.join(digits)
  
print(len(int2base(n,k)))

Solution (Python):


import math

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

i = k
cnt = 0

while True:
  
  if math.floor(n / i) <= 0:
    print(cnt+1)
    break
  
  cnt+=1
  i *= k

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

Solution (Python):
n = list(map(int, input().split()))
dec_num, base_num = n[0], n[1]
ans, n = "", 0

while True:
    if dec_num <= 0:
        break
    
    n = dec_num % base_num
    dec_num = int(dec_num / base_num)
    ans += str(n)

if ans[:1:-1] == "0":
    ans += "1"

ans[::-1]
print(len(ans))

Solution (Python):
line = input('')
n = int(line.split(' ')[0])
k = int(line.split(' ')[1])
ret = 0
for i in range(1,100):
  n2 = k**i
  if n2 > n:
    ret = i
    break
print(ret)

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

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

print(ans)

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

if n == 1:
    res = 1
else:
    res = 1
    while True:
        res += 1
        n = n // k 
        if n < k:
            break

print(res)

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

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

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