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

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

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

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

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





def max_beki(number, k):
    beki = 0
    while k**beki <= number:
        beki += 1
    return beki

res = []
waru_kazu = k**(max_beki(n, k) - 1)
while waru_kazu >= 1:
    shou = n//waru_kazu
    res.append(str(shou))
    n -= shou*waru_kazu
    waru_kazu /= k

print(len(res))

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

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

print(count)

Solution (Python):
n,k = map(int,input().split())
l = []
while n != 0 :
    r = divmod(n,k)
    n = r[0]
    l.append(r[1])
print(len(l))

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

digits = ''
while N >= 1:
  digits += str(N % K)
  N //= K

print(len(digits))

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

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

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

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

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

print(ans)

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

Solution (Python):
import queue
N,K = map(int,input().split())
ans = queue.Queue()
while N >= K:
    N,amari = divmod(N,K)
    ans.put(amari)
ans.put(N)
answer = ""
while not ans.empty():
    answer += str(ans.get())
print(len(answer))

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

Solution (Python):
def answer(n: int, k: int) -> int:
    digits = 0
    while 0 < n:
        n //= k
        digits += 1

    return digits


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


if __name__ == '__main__':
    main()

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

print(count)

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

Solution (Python):
def L():
  return list(map(int, input().split()))
import math
[n,k]=L()

print(math.floor(math.log(n,k))+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())
print(len(Base_10_to_n(N,K)))

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

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

while True:
    if n>=k:
        total.append((n%k))
        n=n//k
    if n<k:
        total.append((n))
        break
print(len(total))

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

i = 0
anslist = []
while True:
  if N>=K:
    i+=1
    anslist.append(N%K)
    N = N//K
    
  if N<K:
    anslist.append(N)
    i+=1
    break
    
anslist.reverse()


print (i)

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


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

Solution (Python):
n = input()
n = n.split()
k = int(n[1])
n = int(n[0])
a = 1
b = 0
while a == 1:
    b = b + 1
    if k**b>n:
        a = 0
print(b)

Solution (Python):

n,k = map(int, input().split())
i=0
a=[]

while n!=0:
    a.append(n%k)

    n=n//k
    i=i+1

print(len(a))

Solution (Python):
def base10toK_base(num, K):
    if num // K:
        return base10toK_base(num//K, K) + str(num % K)
    return str(num % K)

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

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

Solution (Python):

N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    if q <=0 :
        break

n_ary = int("".join(map(str,mod_list[::-1])))
print(len(str(n_ary)))

Solution (Python):

N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    
    
    if q <=0 :
        break
if mod_list[-1] == 0:
    result = len(mod_list) - 1
else:
    result =len(mod_list)
print(result)

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

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

print(ans)

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

    return str(n % k)


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

print(len(calc_digits(n, k)))

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

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

list=[]
while N>=K:
    x=N%K
    N=N//K
    list.append(x)

list.append(N)
print(len(list))

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

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

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

print(ans)

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

def ans156(N:int, K:int):
    length=1
    while True:
        if N<K:
            break
        N=int(N/K)
        length+=1
    return length

print(ans156(N,K))

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

Solution (Python):
import os, sys, re, math

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

d = 0
a = K ** 0
while a <= N:
    d += 1
    a *= K

print(d)

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

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

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

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

Solution (Python):
s, k = map(int,input().split())
c = []
while s > 0:
    a = s % k
    c.append(a)
    s //= k

print(len(c))

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

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

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

if(N==1):
    print(1)
    exit()
print(math.ceil(math.log(N,K)))

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

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

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

print(ans+1)

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


for i in range(100):
    if n//(k**i) == 0:
        if n%(k**i)>=1:
            print(i)
            break
        else:
            print(i-1)
            break

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

for i in range(10**9):
  if n < k**i:
    print(i)
    exit()

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

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

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

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

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

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

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

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


if __name__ == '__main__':
    main()

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

i = 1
cnt = 0
while n >= i:
    i *= k
    cnt += 1

print(cnt)

Solution (Python):
[n, k] = [int(i) for i in input().split()]
for i in range(40):
    if n < k**i:
        print(i)
        break

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

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

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

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

if __name__ == '__main__':
    main()

Solution (Python):


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

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

k_shinsu_list = []
while True:
    k_shinsu_list.append(N % K)
    N = N // K
    if N == 0:
        break
print(len(k_shinsu_list))

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

Solution (Python):
n,k = map(int, input().split())
for i in range(50):
    if n < pow(k,i):
        print(i)
        exit()

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

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

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

Solution (Python):
n,k = [int(x) for x in input().split()]
res = 0
while n > 0:
  n //= k
  res += 1
print(res)

Solution (Python):
n, k = [int(i) for i in input().split()]
cnt = 0
if n == 0:
  print(1)
  exit()
while n != 0:
  n = n // k
  cnt += 1
print(cnt)

Solution (Python):

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

Solution (Python):

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

if __name__ == "__main__":
    main()

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
import bisect
def main():
    N, K = MI()
    ans = 0
    p = 1
    while p <= N:
        p *= K
        ans += 1
    print(ans)

if __name__ == "__main__":
    main()

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

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

    print(ans)

Solution (Python):
import math

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

print(math.ceil(math.log(N,K)) if N!=1 else 1)

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

p=int(math.log2(n))

for i in range(p+2):
    if n//(k**i)<1:
        print(i)
        sys.exit()

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

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

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

print(ans)

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

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

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

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

main()

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

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

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

Solution (Python):
ri = lambda S: [int(v) for v in S.split()]
def rii(): return ri(input())

N, K = rii()

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

print(count)

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

i = 1
temp = k

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

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

for i in range(1000000):
    if k**i > n:
        print(i)
        break

Solution (Python):
import sys
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
ans = 0
while n != 0:
    n = n // k
    ans += 1
print(ans)

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

D = 0

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

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

Solution (Python):
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,k = mi()

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

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())
num=[]
while N >= K:
    num.append(N%K)
    N=N//K
num.append(N)
print(len(num))

Solution (Python):


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

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

print(cnt)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)


INF=10**20
def solve(N: int, K: int):
    ans = 0
    while N >= K:
        N //= K
        ans += 1

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




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

print(ans)

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    digit = 0
    cur = 0

    while cur < N:
        digit += 1
        cur = K ** digit - 1

    print(digit)


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
def tenToK(N, K):
	if N // K:
		return tenToK(N // K, K) + str(N % K)
	else:
		return str(N % K)

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

Solution (Python):



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


if __name__ == "__main__":
    main()

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

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

Solution (Python):

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

cnt = 0

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

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

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

ans = 0

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

print(ans)

Solution (Python):
r=input().split()
N=int(r[0])
K=int(r[1])
l=[]
while N>=1:
    l.append(N%K)
    N=N//K
print(len(l))

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array





sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
INF = float('inf')


def combinations_count(n, r, mod=MOD):
    def factorial_mod(N, mod=MOD):
        ret = 1
        for n in range(1, N + 1):
            ret *= n
            ret %= mod
        return ret

    q = factorial_mod(n + r, mod)
    b = factorial_mod(n, mod)
    d = factorial_mod(r, mod)
    b = pow(b, mod - 2, mod)
    d = pow(d, mod - 2, mod)
    return (q * b * d) % mod


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():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array





sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
INF = float('inf')


def combinations_count(n, r, mod=MOD):
    def factorial_mod(N, mod=MOD):
        ret = 1
        for n in range(1, N + 1):
            ret *= n
            ret %= mod
        return ret

    q = factorial_mod(n + r, mod)
    b = factorial_mod(n, mod)
    d = factorial_mod(r, mod)
    b = pow(b, mod - 2, mod)
    d = pow(d, mod - 2, mod)
    return (q * b * d) % mod


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):



def main():
    N, K = map(int, open(0).read().split())
    i = 0
    while N != 0:
        N = N // K
        i += 1
    print(i)


main()

Solution (Python):

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

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

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

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

Solution (Python):
import math

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

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

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

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

Solution (Python):
n,k=map(int,input().split())
a=0
b=n
while b>=k:

    b=b//k

    a+=1

print(a+1)

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

num = ""
while(N > 0):
  num += str(N % K)
  N = int(N / K)

print(len(num))

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

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

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

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

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

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

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

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

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):



n,k=map(int,input().split())
a=[]
while n>=1:
    s=n%k
    n=n//k
    a.append(s)

print(len(a))

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

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

    ans = b + 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):

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

    for i in range(10 ** 9):
        if N <= K ** i - 1:
            print(i)
            break


if __name__ == '__main__':
    main()

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

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

if N == 1:
  print(1)
  
else:
  for i in range(1, N):
    if K**i > N:
      print(int(i))
      break

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

ans = 0
div = K
while N/pow(K, ans) >= 1:
    ans += 1
    div *= ans
print(ans)

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

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

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

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

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

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

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

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

Solution (Python):
N, K = list(map(int, input().rstrip().split()))
r = 0
while 0 < N:
    r += 1
    N = int(N / K)

print(r)

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

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

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

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

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

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

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

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

print(ans)

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

print(count)

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

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

ans = 0

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

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

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

def abc(n,m):
    a,b = divmod(n,m)
    return a,b

count = 0 
a = 1
while a !=0 :
    a,b = abc(N,K)

    N = a
    count += 1
print(count)

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

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

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

count=1
subk=k

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

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

cnt = 1
power = K

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

print(cnt)

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

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

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

import math

taisu=math.log(n,k)

print(int(taisu)+1)

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

    c = 0
    while True:
        if n >= k ** c:
            c += 1
        else:
            break
    
    print(c)
    return
main()

Solution (Python):

import math

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

n = int(math.sqrt(N)) + 1

for i in range(n, -1, -1):
  if K ** i <= N:
    print(i+1)
    exit()

Solution (Python):
n,k=map(int,input().split())
xx=k
c=0
while xx<=n:
  xx=k**c
  c+=1
if c<1:
  c=2
print(c-1)

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

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

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

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

print(i+1)

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

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

Solution (Python):
sus = ['0','1','2','3','4','5','6','7','8','9']
def base_sus(dig,n):
    if dig == 0: return ""
    return sus[dig%n]+base_sus(dig//n,n)
a,b = map(int,input().split())
print(len(base_sus(a,b)))

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

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

if '__main__' == __name__:
    resolve()

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

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

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

print(a + 1)

Solution (Python):

N, K = map(int, input().split())
div = N // K
digits = []
while div > K:
    div = N // K
    digits.append(str(N % K))
    N   = div
digits.append(str(N % K))
if N // K != 0:
    digits.append(str(N // K))
ans = len(digits)
print(ans)

Solution (Python):
import sys

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

i = 0
while N:
  N //= K
  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)
s = Base_10_to_n(n, k)
print(len(s))

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)
a=Base_10_to_n(X, n)
print(len(str(a)))

Solution (Python):
n,k=map(int,input().split())
x,i=0,0
while n>0:
    x+=(n%k)*10**i
    n=n//k
    i+=1
print(len(str(x)))

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

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

n = 0
x = 0

while True:
    x = K**n
    if x > N:
        n -= 1
        break
    n += 1

ans = []

for i in range(n, -1, -1):
    if K**i < N:
        ans.append(N//(K**i))
        N = N % (K**i)
    else:
        ans.append(0)

print(len(ans))

Solution (Python):
import sys

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

if K == 10:
    print(len(str(N)))
    sys.exit()

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

print(p)

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())
for i in range(n):
    n = n // k
    if n == 0:
        print(i + 1)
        exit()

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

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

    print(digits)

if __name__ == "__main__":
    solve()

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

def dec2n(int1, int2):
  l = ""
  while int1 != 0:
    l += str(int1 % int2)
    int1 = int1 // int2
  return l[::-1]

if K == 10:
  print(len(str(N)))
else:
  print(len(dec2n(N, K)))

Solution (Python):
n, k = map(int, input().split())
x = k
i = 1
while n >= x:
    i += 1
    x *= k
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)
print(len(Base_10_to_n(n,k)))