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

Solution (Python):
N,K=map(int,input().split())
def change(n,k):
    res=[]
    m=n
    while(m>0):
        res.append(m%k)
        m=m//k
    return res
print(len(change(N,K)))

Solution (Python):
def main():
    N, K = map( int, input().split())
    for i in range(1,100):
        if N//pow(K,i) == 0:
            print(i)
            break
if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

Solution (Python):


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

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

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

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

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

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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,k=map(int,input().split())
while pro <= n:
  pro *= k
  count += 1
print(count)

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

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

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

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

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

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




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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque, Counter
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math
INF = 10 ** 20

def main():
    a, b = getList()
    ans = 1
    while(a >= 1):
        ans += 1
        a = a/b

    print(ans - 1)

if __name__ == "__main__":
    main()

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

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]




n,k=mii()

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

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

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

Solution (Python):

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

Solution (Python):
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]


def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n,k = get_nums_l()

ans = 0

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

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

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


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




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

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

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

ANS=0
while N:
    N-=N%(K**ANS)
    ANS+=1
print(ANS-1)

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

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

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

print(a)

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

t = 0
for i in range(n):
    n = n // k
    t += 1
    if n == 0:
        break
print(t)

Solution (Python):
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]





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

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

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

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

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())
ans = 0
while n > 0:
    n = 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())

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

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

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

    d = 1
    while True:
        if n <= (k ** d) - 1:
            print(d)
            return
        d += 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())

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

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


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



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

Solution (Python):
def to_k_base_num(n,k):
    bi = ""
    while n != 0:
        bi += str(n%abs(k))
        if k < 0:
            n = -(-n//k)
        else:
            n //= k
    return bi[::-1]

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

if __name__ == '__main__':
    main()

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

Solution (Python):



import sys
readline = sys.stdin.readline
read = sys.stdin.read





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

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

print(res)

Solution (Python):
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
res = 0
while N >= pow(K, res): res += 1
print(res)

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

Solution (Python):
from collections import *
from itertools import *
from bisect import *
import copy

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

count=0
while N:

    N//=K
    count+=1


print(count)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

Solution (Python):
def examA():
    N, R = LI()
    ans = R+100*max(0,(10-N))
    print(ans)
    return

def examB():
    N, K = LI()
    ans = 1
    while(N>=K):
        N //=K
        ans += 1
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

"""

"""

Solution (Python):
import sys

stdin = sys.stdin

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

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

Solution (Python):


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


if __name__ == "__main__":
    solve()

Solution (Python):
import sys
from operator import itemgetter
from collections import deque, Counter
from itertools import permutations, combinations
from heapq import heapify, heappop, heappush
from bisect import bisect, bisect_left

def solve():
    input = sys.stdin.readline
    N, K = map(int, input().split())
    dig = 0
    while N > 0:
        N //= K
        dig += 1
    print(dig)

    return 0

if __name__ == "__main__":
    solve()

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

base = 1
for i in range(10000):
    if n//base >= 1:
        base *= k
    else:
        print(i)
        break

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


main()

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

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

t = K
cnt  = 1
while True:
    if t>N:
        break
    t *= K
    cnt += 1
print(cnt)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,k=INTM()
    ct=0
    while n>0:
        n=n//k
        ct+=1
    print(ct)
if __name__ == '__main__':
    do()

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

def base(x,p):
    if int(x/p) >= 1:
        return base(int(x/p),p)+str(x%p)
    return str(x%p)

print(len(base(N,K)))

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input()) 
def inpm(): return map(int,input().split()) 
def inpl(): return list(map(int, input().split())) 
def inpls(): return list(input().split())  
def inplm(n): return list(int(input()) for _ in range(n)) 
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)] 
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) 

def main():
    n,k= inpm()
    ans = 0
    while n > 0:
        n//=k
        ans += 1
    print(ans)
    
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())
ans = 1
while N>=K:
    ans += 1
    N//=K
print(ans)

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

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

print(res)

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

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

ans = 0

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

print(ans)

Solution (Python):
a,b = map(int,input().split())
c = 0
while a != 0:
  a -= a%b
  a //= b
  c += 1
print(c)

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,K=MI()
    ans = 0
    while N:
        ans += 1
        N//=K
    print(ans)
if __name__ == '__main__':
    main()

Solution (Python):


import sys
sys.setrecursionlimit(300000)


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

Solution (Python):

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

Solution (Python):
def pin(type=int):
    return map(type,input().split())
    

"""
"""


def dfs_search_2Dgrid(h,w):
    
    
    
    
    pass

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

Solution (Python):

import sys
import math
INF = float("inf")


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


def main():

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys

stdin = sys.stdin

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

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

Solution (Python):



def convert_decimal_to_n_ary_number(n: int, m_ary_number: int = 2) -> int:
    '''Represents conversion from decimal number to n-ary number.
    Args:
        n: Input number (greater than 1).
        m_ary_number: m-ary number (from 2 to 10).
    Returns:
        values of m-ary number.
    Landau notation: O(log n)
    '''
    if n < m_ary_number:
        return n

    ans = ''

    while n >= m_ary_number:
        p, q = divmod(n, m_ary_number)
        n = p
        ans += str(q)

        if n < m_ary_number:
            ans += str(p)

    return int(ans[::-1])


def main():
    n, k = map(int, input().split())
    print(len(str(convert_decimal_to_n_ary_number(n, k))))


if __name__ == '__main__':
    main()

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


N, K = list(map(int, sys.stdin.buffer.readline().split()))
ans = 0
while N > 0:
    ans += 1
    N //=K
print(ans)

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()
    print(int(math.log(n,k))+1)
    return


if __name__ == "__main__":
    solve()

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n,k=MI()
    ans=0
    while n:
        n//=k
        ans+=1
    print(ans)

main()

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

Solution (Python):




import sys
from fractions import gcd
from itertools import groupby as gb
from itertools import permutations as perm
from itertools import combinations as comb
from collections import Counter as C
from collections import defaultdict as dd
sys.setrecursionlimit(10**5)
def y(f):
    if f:
        print('Yes')
    else:
        print('No')
def Y(f):
    if f:
        print('YES')
    else:
        print('NO')
def Z(f):
    if f:
        print('Yay!')
    else:
        print(':(')
def ispow(n):
    if int(n**.5)**2==n:
        return True
    return False


a,b = map(int,input().split())
res = 0
while a > 0:
    res += 1
    a //= b
print(res)