Problem:
 Score : 200 points    Problem Statement Given is an integer N . Find the number of digits that N has in base K .      Notes For information on base- K representation, see Positional notation - Wikipedia .      Constraints  All values in input are integers.  1 \leq N \leq 10^9  2 \leq K \leq 10         Input Input is given from Standard Input in the following format:  N  K       Output Print the number of digits that N has in base K .        Sample Input 1 11 2      Sample Output 1 4  In binary, 11 is represented as 1011 .       Sample Input 2 1010101 10      Sample Output 2 7       Sample Input 3 314159265 3      Sample Output 3 18

Solution (Python):
import sys








mod = int(1e9+7)
INF = 1<<29

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

if __name__=='__main__':
    main()

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

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

print(int(t)+1)

Solution (Python):
X, n = 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 = X 
x2 = Base_10_to_n(x10, n)
print(len(x2))

Solution (Python):

import math

n, k = map(lambda x: int(x), input().split())


tst = math.log(n, k)
if tst * 1.0 == math.floor(tst):
    print(math.floor(tst)+1)

else:
    print(math.ceil(tst))

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

cnt = 0

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

print(cnt)

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

if N ==1:
    print(1)
else:
    d = 0
    while K ** d <= N:
        d +=1
    print(d)

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

while not (N >= K ** l and N <= K ** (l+1) - 1):
    l += 1
print(l+1)

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

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

Solution (Python):
N, K = map(int, input().split())
ans = 0
while N!=1 and N!=0:
    N = N // K
    ans += 1
if N == 1:
    ans += 1
print(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 =len(base_10_to_n(N,K))
print(X)

Solution (Python):

from collections import deque, defaultdict
import bisect


def comb(a, b):
    result = 1
    for i in range(b):
        result *= (a - i) / (i + 1)
    return result


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

    k = 1
    while True:
        if N < K ** k:
            break
        k += 1

    print(k)


if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
i = 1

def func(i):
    while True:
        if N < K ** i:
            return i
        i += 1

print(func(i))

Solution (Python):
import math

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

Solution (Python):

import collections
import itertools as it
import math
import numpy as np









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

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


print()

Solution (Python):

 
import math
import itertools
import sys
import copy
import numpy as np







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

M = np.base_repr(N, K)
print (len(str(M)))

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

ans = str()

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

if n == 0:
    print(len(ans))
else:
    print(len(str(n) + ans))

Solution (Python):

import math
def main():
    N,K = map(int,input().split())
    num = 0
    while True:
        if (K**(num-1))<= N < (K**num):
            print(math.ceil(num))
            break
        num+=1
if __name__ == '__main__':
    main()

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

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

count = 0
i = 1
while(i <= N):
  count += 1
  i = i * K
print(count)

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

if N < K:
    print(1)
else:
    count = 0
    while N > K:
        M = N%K
        N = N//K
        if N >= K:
            count += 1
    print(count + 2)

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

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



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

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

Solution (Python):
def ten2k(n,k):
    if (int(n/k)):
        return ten2k(int(n/k), k) + str(n%k)
    return str(n%k)

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

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

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

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

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

    i = 0
    while True:
        if N  >= pow(K,i):
            i += 1
        else:
            break

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

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

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

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

print(len(ans))

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

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

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

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

print(i)

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

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

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

Solution (Python):
nk = list(map(int, input().split()))
n = nk[0]
k = nk[1]

res = ''
tmp = n
while tmp >= k:
    res = str(tmp%k) + res
    tmp = int(tmp/k)
res = str(tmp%k) + res
print(len(res))

Solution (Python):


import sys
from math import floor, log


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

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


if __name__ == "__main__":
    main()

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

Solution (Python):

k,r = input().split()
def numberToBase(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return digits[::-1]


print(len(numberToBase(int(k),int(r))))

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

A = list(map(int, input().split()))
print(base10(A[0],A[1]))

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

Solution (Python):
N, K = (int(nk) for nk in input().split())
count = 1
while N > K-1:
    N //= K
    count += 1

print(count)

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

Solution (Python):
import math

def finddigit(n, b):
    dig = (math.floor(math.log(n)/math.log(b))+1)
    print(dig)

n,b = map(int,input().split())
finddigit(n,b)

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

count = 1
X = K

while X <= N:

    count += 1
    X = X*K
print(count)

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

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

print(count)

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)


if __name__ == '__main__':
    n, k = list(map(int, input().split(" ")))
    
    
    
    x2 = Base_10_to_n(n, k)
    print(len(x2))

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

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

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

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

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

if k == 10:
    print(len(str(n)))
else:
    print(len(Base_10_to_n(n,k)))

Solution (Python):
def resolve():
    n, k = map(int, input().split())
    arr = []
    while n > 0:
        arr.append(n % k)
        n = n // k
    print(len(arr))

if __name__ == '__main__':
        resolve()

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

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

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

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

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

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

for ans in range(1000000000):
     if n < k**ans:
          print(ans)
          break

Solution (Python):
a = input().split()
a=[int(i) for i in a]
n,k=a[0],a[1]
r=0
b=1
while r<1:
    if n>=k**b:
        b=b+1
    else:
        r=1
print(b)

Solution (Python):

n,k = map(int, input().split())
keta = 0
saidai = 0
i = 1

while(1):
    saidai = k**i
    if(saidai>n):
        break

    i = i + 1

print(i)

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

ans = 0
i = 1
while n >= k:
    ans += (n % k) * i
    n = int(n / k)
    i *= 10
ans += n * i
s = str(int(ans))
print(len(s))

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

def conv(n, k):
    amari = []
    while n != 0:
        amari.append(n%k)
        n = n // k

    amari.reverse()
    return amari

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

Solution (Python):

si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nms = lambda: map(str, input().split())
nl = lambda: list(map(int, input().split()))
from math import log
n,k=nm()
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())

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

x = 1
while True:
    m = K ** x
    if N < m:
        print(x)
        exit()
    x += 1

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

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

print(result)

Solution (Python):
def main(n, b):
    if (int(n/b)):
        return main(int(n/b), b) + str(n%b)
    return str(n%b)

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

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

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

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

Solution (Python):
from math import log, ceil


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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
n,k=map(int,input().split())
keta=0
p=0
while p==0:
    if n>=k**(keta) and n<k**(keta+1):
        p=1
    else:
        keta=keta+1

print(keta+1)

Solution (Python):
n, k = [int(i) for i in input().split()]
def decNbin(t, n):
  a = []
  while t!= 0:
    a.append(t % n)
    t  = t // n
  a.reverse()
  return a
print(len(str("".join(map(str, decNbin(n, k))))))

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

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

Solution (Python):
ans = 1

n, K  = map(int, input().split())
while ((n != 1) and (n != 0)):
    n //= K
    ans += 1

if n == 0:
    ans -= 1
print(ans)

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

print(ans)

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

n, b = map(int,input().split()) 
ans = base10to(n,b)
print(len(ans))

Solution (Python):
import math

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

digit = math.log(n, k)

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

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

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

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

ans = -1
for i in range(1, 40):
    if K ** (i - 1) <= N < K ** i:
        ans = i

print(ans)

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

tmp = n
ans = 0
while True:
    tmp = int(tmp/k)
    ans += 1
    if tmp == 0:
        break
print(ans)

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

while N//K!=0:
  ans.append(N%K)
  N=N//K
else:
  ans.append(N)
print(len(ans))

Solution (Python):
import math

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

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



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

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

Solution (Python):
list = input().split()
N = int(list[0])
K = int(list[1])
x = 0
while True:
  if K**x > N:
    break
  x += 1
    
print(x)

Solution (Python):

import math

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

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

print( A)

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

keta = 1
sum = 0
while True:
    max = k**keta-1
    if max >= n:
        print(keta)
        break
    keta += 1

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

def base_10_to_n(x, i):
  if i == 10:
    return str(x)
  if (int(x / i)):
    return base_10_to_n(int(x / i), i) + str(x % i)
  return str(x % i)

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

Solution (Python):
import math

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

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

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

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

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

Solution (Python):


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

Solution (Python):
from sys import stdin


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 get_result(data):
    N, K = data[0]
    return len(Base_10_to_n(N, K))

if __name__ == '__main__':
    raw_data = [val.rstrip('\n') for val in stdin.readlines()]
    data = [list(map(int, val.split(' '))) for val in raw_data]
    result = get_result(data)
    print(result)

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

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

Solution (Python):

import math 
n , base = map(int, input().split(" "))
print (math.floor(math.log(n)/math.log(base)) + 1)

Solution (Python):
def new_value(value, shinsu):
    count = 0
    while(value > 0):
        count += 1
        value //= shinsu
        
    return count

if __name__ == '__main__':
  value, shinsu = input().split()
  value = int(value)
  shinsu = int(shinsu)
  
  print(new_value(value, shinsu))

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

Solution (Python):
N, K = list(map(int, input().split()))
c = 1
for _ in range(10**15):
    N = (N - N % K) // K
    if N == 0:
        break
    c += 1
print(c)

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

for i in range(1, 10000000000000):
    if k**i > n:
        print(i)
        break

Solution (Python):
def solve(X, n):
    if X // n != 0:
        return solve(X // n, n) + str(X % n)
    return str(X % n)

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

print(len(solve(N, K)))

Solution (Python):
import  math
N, K = map(int, input().split())
t = 1
x = N
n = 0
while (True):
    n += 1
    x -= t * (K - 1)
    if x <= 0:
        break

    t *= K


print(n)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


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



if __name__ == '__main__':
    solve()

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







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

print(ans)

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

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

print(ans)

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

Solution (Python):

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

if N < K:
    print(1)
else:
    ans = 0
    for i in range(1, N // 2):
        if N < (K ** i):
            ans = i
            break

    print(ans)

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

number_list = [int(i) for i in input().split()]
n_val = base_10_to_n(number_list[0], number_list[1])
len_val = len(n_val)
print(len_val)

Solution (Python):



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

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

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

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

ans = - (-math.log(n)//math.log(k))

print(int(ans))

Solution (Python):

import sys
input = sys.stdin.readline


def main():
    n, k = map(int, input().split())
    r = n
    u = []
    while(r >= k):
        s = r // k
        t = r % k
        u.append(t)
        r = s
    u.append(r)
    print(len(u))


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

Solution (Python):


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

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

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

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

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

a = []

while N >= K:
    y = N % K
    a.append(str(y))
    N = N // K

x = N % K

a.append(str(x))

ans = len(a)

print(ans)

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

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

    base_num = base_num[::-1]  
    return base_num

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

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

Solution (Python):
import itertools


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



i =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)


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

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


result = Base_10_to_n(input_line[0], input_line[1])
print(len(result))

Solution (Python):
import math

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

Solution (Python):
n, k = map(int, input().split())
def tanaka(n,k):
  if (int(n/k)):
    return tanaka(int(n/k),k)+str(n%k)
  return str(n%k)

print(len(tanaka(n, k)))

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

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


def to_str(n, base):
    convert_string = "0123456789ABCDEF"
    if n < base:
        return convert_string[n]
    else:
        return to_str(n // base, base) + convert_string[n % base]


print(len(to_str(N, K)))

Solution (Python):
N,K = list(map(int, input().split()))
s = []
while N > 0:
    amari = N % K
    N = N - amari
    N = N / K
    s.append(amari)
print(len(s))

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

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

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

print(len(digit)+1)

Solution (Python):
from math import log

number, base = map(int, input().split())
digit = int(log(number, base)) + 1
print(digit)

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


res = 0

while N != 0:

    res += 1
    N //= K


print(res)

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

Solution (Python):
def main(n,k):
    res = 0
    val = 1
    while val <= n :
        res += 1
        val = val * k
    return res
 
n,k = map(int, input().split())
print(main(n,k))

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



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

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

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

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)

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

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

def b10_to_n(x, n):
    s = str()
    while True:
        xx = x // n
        s += str(x % n) 
        x = xx
        if x == 0:
            break
    return s

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

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


if __name__ == '__main__':
    main()

Solution (Python):


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

result = ""
temp = n
while temp >= 1:
    result = str(temp % k) + result
    temp = temp // k

print(len(result))

Solution (Python):
import sys

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

Solution (Python):




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


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


if __name__ == "__main__":
    main()

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

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

  digit = 0

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

if __name__ == '__main__':
  main()

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

n = 0
count = 1

while True:
	n = N // K
	if n == 0:
		break
	else:
		N = N // K
		count += 1

print(count)

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

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

ans = ""

while True:
  r = str(N % K)
  ans += r
  N = N // K
  if N < K:
    ans += str(N % K)
    break

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

print(len(ans))

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

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

print(num)

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

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

Solution (Python):
import math

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

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

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

def clac(n, k):
    x = []
    while(n > 0):
        x.append(str(n%k))
        n = n//k
    return ("").join(x[::-1])

print(len(clac(N, K)))

Solution (Python):


from collections import defaultdict

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

ans = 0

while n != 0:
    n //= k
    if n != 0:
        ans += 1

print(ans + 1)

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

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


while N // K != 0:
    n = N // K
    N = n
    count += 1

print(str(count + 1))

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

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


for i in range(40,-1,-1):
    if r**i<=n:
        ans=i+1
        break
print(ans)

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

Solution (Python):
def main():
    n, k = map(int, input().split())
    count = []
    while n != 0:
        count.append(n % k)
        n = n // k
    print(len(count))


if __name__ == "__main__":
    main()

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

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

print(count)

Solution (Python):

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

ans = 1
sum = k

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

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

print(ans)

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

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

i = 1
while (K ** i) - 1 < N:
  i += 1

print(i)

Solution (Python):

def keta(x):
    cnt=0
    while x>0:
        x=int(x/k)
        cnt+=1
    return cnt
n,k=map(int,input().split())
ans=keta(n)
print(ans)

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


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

Solution (Python):
a,b = map(int,input().split())
def baseN(num, b, numerals="0123456789abcdefghijklmnopqrstuvwxyz"):
    return((num == 0) and numerals[0]) or (baseN(num // b, b, numerals).lstrip(numerals[0]) + numerals[num % b])
print(len(baseN(a, b)))

Solution (Python):
a = input().split()
for i in range(len(a)):
    a[i] = int(a[i])

ind = 0
while a[0] > 0:
    a[0] = a[0] // a[i]
    ind +=1

print(ind)

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

print(c)

Solution (Python):
import math

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


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

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

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

stopFlg = True
result = ''
nowValue = n
while nowValue >= k:
    result = str(nowValue%k) + result
    nowValue = nowValue // k
result = str(nowValue%k) +result
print(len(result))

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

Solution (Python):
import math

a,b=map(int,input().split())

if math.log(a,b).is_integer():
    print(math.ceil(math.log(a,b))+1)
else:
    print(math.ceil(math.log(a,b)))

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