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

Solution (Python):
def Base_10_to_n(X, n):
    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):
n,k = map(int,input().split())
c=1

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

print(c)

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

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

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

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

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

Solution (Python):
input=input().split()
N=int(input[0])
K=int(input[1])
i=1
while(K**i<=N):
    i=i+1
print(i)

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


main()

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

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

n_s = n + 1

cnt = 1

while True:
    if n < k**cnt:
        print(cnt)
        exit()
    else:
        cnt += 1

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

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())
print(math.floor(math.log(N, K))+1)

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

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

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

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

i = 1

while True:
    if K ** i > N:
        break

    i += 1

print(i)

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

print(cnt)

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

Solution (Python):
import string
d = string.digits + string.ascii_letters


def con(x, base):
    if x < 0:
        sign = -1
    elif x == 0:
        return d[0]
    else:
        sign = 1
    x *= sign
    digits = []

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

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

    return ''.join(digits)
n,k = map(int,input().strip().split())
v = con(n,k)
print(len(v))

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

print(cnt)

Solution (Python):

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


import string
numbers = "0123456789"
alphabets = string.ascii_letters 
characters = numbers + alphabets
 
def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
 
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result

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

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

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

Solution (Python):

N,K = (int(x) for x in input().split(" "))
N_a = N
a =0
b =0
amari = []

while K <= N_a :
    a,b = divmod(N_a,K) 
    
    amari.append(b)
    N_a = a
amari.append(a)


print(len(amari))

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

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

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

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

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

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

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

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

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

Solution (Python):
def main():
    a, b = list(map(int, input().split()))
    d = 1
    while True:
        if b**d > a:
            break
        else:
            d += 1
    print(d)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    a, b = list(map(int, input().split()))
    flag = 1
    d = 1
    while flag:
        if b**d > a:
            flag = 0
        else:
            d += 1
    print(d)


if __name__ == "__main__":
    main()

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

check_n = k
counter = 1

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

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

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

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

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

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

while(N > 0):
    ret += N%K*pow(10,i)
    N = int(N/K)
    i += 1

print(len(str(ret)))

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

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

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

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

while n>=k:
    cal=n%k
    if cal!=0:
        n-=cal
    a.append(cal)
    n=n/k
a.append(1)
ans=len(a)
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)
def main():
    N,K = map(int,input().split())
    print(len(str(Base_10_to_n(N,K))))
main()

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

for i in range(10000):
    k = y**i
    if k > x:
        break
print(i)

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

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

def resolve():
    import math
    n, k = map(int, input().split())
    i = 1
    count = 1
    while k**i <= n:
        count += 1
        i += 1
    print(count)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """11 2"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """1010101 10"""
        output = """7"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """314159265 3"""
        output = """18"""
        self.assertIO(input, output)


if __name__ == "__main__":
    
    resolve()

Solution (Python):
import numpy as np
import math

n,k = str(input()).split()
if int(n) == 0:
    print(1)
else:
    ans = np.log(int(n))/np.log(int(k))
    print(int(ans)+1)

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

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


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

    print(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):
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):
NK=list(map(int,input().strip().split()))
N=NK[0]
K=NK[1]

for n in range(1,36):
    if N<K**n:
        digit=n
        break
print(digit)

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

i=0

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

print(i)

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

i = 0
while (N//(K**i) >= 1):
    i += 1

print(i)

Solution (Python):
N,K=map(int,input().split())
x=[]
while True:
  show=N//K
  res=N%K
  x.append(res)
  N=show
  if show==0:
    break
print(len(x))

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

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

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

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

for i in range(10000):
    while k**i > n:
        print(i)
        exit()

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

while True:
    if n >= k:
        n = n/k
        d = d + 1
    else:
        print(d)
        break

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

ans = 0

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


print(ans)

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

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

ans = fanc(n, r)
print(len(ans))

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

    ans = 0
    while pow(k, ans) <= n:
        ans += 1

    print(ans)

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

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

Solution (Python):
def main():
    N, K = map(int, input().split())
    cnt = 1
    while pow(K, cnt) <= N:
        cnt += 1
    print(cnt)
    return


main()

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

n_shin = []

tmp = n
while True:
    n_shin.append(str(tmp % k))
    tmp = int(tmp / k)
    if tmp == 0:
        break

print(len(n_shin))

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

Solution (Python):
num,n = map(int,input().split())
counter = 0
temp = 0
while num - n**temp >= 0:
    temp += 1
    counter +=1

print(counter)

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

for i in range(1, 40):
    if K**(i-1) <= N < K**i:
        print(i)
        sys.exit()

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

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

Solution (Python):
input_list=  list(map(int, input().split()))
tmp=input_list[0]
for i in range(10**9):
    if input_list[0] >= input_list[1]**i:
        continue
    else:
        print(i) 
        break

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

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

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

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

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

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

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

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

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

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

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

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

while number[1]**i <= number[0]:
  i += 1

print(i)

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

def shinsu(n,k):
    result = ''
    while n>=k:
        result += str(n%k)
        n = n//k
    result += str(n)
    return result[::-1]

print(len(shinsu(n,k)))

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


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

print(ans)

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

print(count+1)

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

cnt=0

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

print(cnt+1)

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

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

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

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

Solution (Python):
A,B = map(int,input().split())
cnt = 0

if A < B:
  print(A)
  exit()
while B <= A:
  A = A // B
  cnt += 1
print(cnt + 1)

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

print(math.ceil(x))

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

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

print(len(base10to(N, K)))

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

Solution (Python):
n,k=map(int,input().split())
bin=0
for m in range(0,100):
  if n<k**m:
    bin=m
    break
print(bin)

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

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

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

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

Solution (Python):

import math

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

if(int(math.log(n,k)) != math.log(n,k)):
  t1 = math.ceil(math.log(n,k))
else:
  t1 = math.ceil(math.log(n,k)) + 1

print("{}".format(t1))

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

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

print(ans)

Solution (Python):
N, K = [int(_) for _ in input().split()]
for a in range(1, 10**9):
    N = int(N / K)
    if N <= 0:
        print(a)
        break

Solution (Python):
N, K = [int(_) for _ in input().split()]
for a in range(0, 10**9):
    if K**(a) <= N < K**(a+1):
        print(a+1)
        break

Solution (Python):
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd



import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    n, k = map(int, input().split())
    d = int(math.log(n, k) + 1)
    print(1 if d == 0 else d)


if __name__ == '__main__':
    main()

Solution (Python):
import math
N, K = map(int,input().split())
M = ""
while True:
  M = str(N%K) + M
  N = N//K
  if N//K ==0:
    M = str(N) + M
    break
if(M[0]=="0"): M = M[1:]
print(len(M))

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

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

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

i = 0

while N >= K ** i:
  i += 1

ans = i
print(ans)

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

Solution (Python):
a=input()
(n,m)=a.split(" ")
n=int(n)
m=int(m)
l=[]
rev=0
while n>0:
    re=n%m
    l.append(re)
    n=n//m
print(len(l))

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

ans = []

d = N
while d >= K:
    d, m = divmod(d, K)
    ans.insert(0, str(m))

ans.insert(0, str(d))
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):
N,K = [int(i) for i in input().split()]
ret = 1

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

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

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

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

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

print(res)

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

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

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

X = 0
n = 1
while n <= N:
    X += 1
    n = n * K
print(X)

Solution (Python):
n, k = map(int, input().split())
if k == 10:
    print(len(str(n)))
else:
    if n < k:
        print(1)
        exit()
    t = n//k
    c = 1
    while t >= k:
        c += 1
        t = t//k
    print(c+1)

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

digit = 1
while n >= pow(k,digit):
  digit += 1

print(digit)

Solution (Python):

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

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

Solution (Python):

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

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

Solution (Python):
def digits_156_b(n: int, k:int) -> int:
    count = 0
    while n > 0:
        n = n // k
        count += 1
    return(count)

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

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

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect


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


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


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


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n, k = LI()

    def a(n, k):
        if (n//k):
            return a(n//k, k)+str(n % k)
        return str(n % k)
    print(len(a(n, k)))
    return



if __name__ == "__main__":
    solve()

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

result = 1
tmp = K

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

print(result)

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


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


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

Solution (Python):
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
  
a, b = map(int, input().split(" "))

print(len(base_cvt(a,b)))

Solution (Python):
import math

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

print(num)

Solution (Python):
a, b = map(int, input().split())
c = b
count = 1
while (a >= b):
    b *= c
    count += 1
print(count)

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

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

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

print(answer)

Solution (Python):
import math

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

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

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

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

Solution (Python):
n, k = map(int, input().split())
n_k = ""
while True:
    temp = n % k
    if n != 0:
        n_k += str(temp)
    else:
        break
    n //= k
n_k = n_k[::-1]
print(len(n_k))

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

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

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

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

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

Solution (Python):


t = input().split()
n = int(t[0])
k = int(t[1])

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

Solution (Python):
import math

N, K = ( int(x) for x in input().split(' '))

tmp = ''
while N > 0:
  tmp = tmp + str(N % K)
  N = math.floor(N / K)

print(len(tmp))

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

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

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

    ans = []
    n = N
    for _ in range(N):
        n, mod = divmod(n, K)
        ans.append(mod)
        if n == 0:
            break

    print(len(ans))


if __name__ == "__main__":
    main()

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

Solution (Python):
N, K = map(int, input().split())
if K == 10:
  print(len(str(N)))
else:
  res = 1
  KK = K
  while KK <= N:
    res += 1
    KK *= K
  print(res)

Solution (Python):
import numpy as np

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

max_base = [30, 22, 15, 14, 13, 12, 11, 10, 9]
base = np.array([i for i in range(max_base[K-2])])

base = K**base

target = np.array([N]*max_base[K-2])

index = np.where(base <= target, 1, 0)

print(np.sum(index))

Solution (Python):


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

i = 1

while N//(R**(i)) > 1:
    if N//(R**(i+1)) == 0:
        break
    i += 1

if N//(R**i) == 0:
    print(i)
else:
    print(i + 1)

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

N_ = N
digits = 0
i = 0
while N_ / K >= K:
  digits += (10 ** i) * (N_ % K)
  N_ = int(N_ / K)
  i += 1

N_ = int(N_ / K)
digits += (10 ** (i + 1)) * (N_ % K)

print(len(str(digits)))

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

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


c = 0 

def cnt(num, radix):
    x = num // radix
    global c 
    c += 1
    if x == 0:
        return c
    else:
        return cnt(x, radix)

cnt(n, k)
print(c)

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

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

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

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

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

print(c)

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

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

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

Solution (Python):
X,n = (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)

print(len(Base_10_to_n(X, n)))

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

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

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

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

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

for i in range(10000):
    n_min = k ** (i - 1)
    n_max = k ** i
    if n_min <= n and n_max > n:
        print(i)
        break

Solution (Python):
import math

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


main()

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


main()

Solution (Python):
NKlist = input().split(" ")

n = int(NKlist[0])
k = int(NKlist[1])

count = 0

for i in range(50):
    if n >= k**i:
        count = count + 1
    else:
        break

print(count)

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())
J=K
ans=1

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

print(ans)

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

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

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

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

print(ans)

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

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

ans = 0

for i in range(n):
    if (n // (k ** i)) > 0:
        ans = i + 1
    else:
        break

print(ans)

Solution (Python):
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd



import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    n,k = map(int,input().split())
    eprint('math.log(n,k) ', end=':\n')
    eprint(math.log(n,k))
    d = math.ceil(math.log(n,k))
    print(1 if d ==0 else d)

if __name__ == '__main__':
    main()

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

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

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

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

x = ""

while n > 0:
    x = str(n % k) + x
    n //= k

print(len(x))

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

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

ans = 1
m = N

while m!=0:
    if m//K!=0:
        ans += 1
    m //= K
    
print(ans)

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

for a in range(1,35):
  if n//(k**a) == 0:
    print (a)
    break