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


def solve(N: int, K: int):
    c = 0
    while True:
        if K ** c > N:
            print(c)
            return
        else:
            c += 1



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

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

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

print(len(solver2(N, K)))

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

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

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

Solution (Python):

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


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


print(ans)

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

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

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

for i in range(1,2**27):
  if K**(i-1) <= N < K**i:
    print(i)
    break

Solution (Python):






n, k = map(int, input().split())
count=1
base = k
while n >= k:
    count += 1
    k *= base

print(count)

Solution (Python):
def Base_10_to_n(X, K):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%K)+out
        X_dumy = int(X_dumy/K)
    return out
n, k = map(int, input().split())
print(len(Base_10_to_n(n, k)))

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

Solution (Python):
def main():
    n,k = map(int, input().split())
    
    ans = 1
    for j in range(100000):
        ans *= k
        if ans > n:
            print(j+1)
            break
        elif ans == n:
            print(j+2)
            break

if __name__ == '__main__':
    main()

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

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

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

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

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

print(ans)

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

Solution (Python):
import math

def resolve():
    N,K = list(map(int, input().split()))
    if N==0:
        print('1')
    else:
        print(int(math.log(N, K))+1)

resolve()

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

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

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

print(cnt)

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

Solution (Python):
import math

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

    if n == 1:
        print(1)
        return
    print(math.ceil(math.log(n, k)))


if __name__ == '__main__':
    main()

Solution (Python):
n, k = map(int, input().split())
ans = []
while n >= k :
  n = n // k
  mod = n % k
  ans.append(mod)
ans.append(n)  
print(len(ans))

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

for i in range(10**7):
    if k**i > n:
        print(i)
        exit()

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


if __name__ == '__main__':
    main()

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

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

result = 0

r = n
while(True):
    r //=  k
    result += 1
    if r <= 0:
        break
    
    
print(result)

Solution (Python):
n, k = map(int, input().split())
 
tmp = 1
for i in range(100):
    tmp = k * tmp

    if n < tmp:
        print(i+1)
        exit()

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

Solution (Python):
def main():
    N, K = [int(_) for _ in input().split()]
    i = 1
    while True:
        N_quotient = N // K
        N = N_quotient
        if N != 0:
            i += 1
        else:
            break
    print(i)
main()

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

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

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

Solution (Python):
def contest(N, R):
    i = 0

    while(N >= R):
        i += 1
        N = N // R
    
    return i+1

if __name__ == "__main__":
    N, R = map(int, input().split())
    print(contest(N,R))

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


print(ans +1)

Solution (Python):
n,k=map(int,input().split())
A=[]
while n//k!=0:
  A.append(n%k)
  n=n//k
print(len(A)+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)
  
ans=Base_10_to_n(n,k)
print(len(ans))

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

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

print(i)

Solution (Python):



import math

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

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

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

ans=0
for i in range(30):
  n=N-K**i
  if n<0:
    break
  ans+=1

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

x10 = N
output = int(Base_10_to_n(x10, K))

count = 1



while output>=10:
    count+=1
    output/=10

print(count)

Solution (Python):
import sys

sys.setrecursionlimit(1000000)
input = lambda: sys.stdin.readline().rstrip()

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

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

ans=0
for i in range(30):
  n=N-K**i
  if n<0:
    break
  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)
    

i = Base_10_to_n(n, k)
print(len(str(i)))

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

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



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

Solution (Python):
n,k = list(map(int,input().split()))
tmp = n
count = 0
f = True
while f:
  tmp = int(tmp / k)
  count += 1
  if tmp == 0:
    f = False
  
print(count)

Solution (Python):
n,k = map(int,input().split())
ans = 0
while n != 0:
  n = int(n / k)
  ans += 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 = list(map(int, input().split()))
ans = Base_10_to_n(N, K)
print(len(ans))

Solution (Python):
MAX_N = pow(10, 9)
n, k = map(int, input().split())

for i in range(MAX_N):
    if n < pow(k, i):
        print(i)
        break

Solution (Python):
from sys import stdin
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 = 0
while N >=1:
  N //= K 
  count += 1
print(count)

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

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

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

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

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())
for i in range(N):
    N = N//K
    if N<=0:
        break
print(i+1)

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

ans = 0
while True:
    N //= K
    ans += 1
    if N == 0:
        break

print(ans)

Solution (Python):

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

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

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

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

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

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


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


if __name__ == "__main__":
    main()

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

a=list[0]
b=list[1]
c=0
while a>0:
	a=a//b
	c=c+1
print(c)

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

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

print(len(a))

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

Solution (Python):
from sys import stdin
import math

n, k = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 1
if n < k:
    print(cnt)

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

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

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

Solution (Python):
def ten_to_n(X, n):
    i = X // n
    s = str(X % n)
    if (i):
        return ten_to_n(i, n) + s
    return s

def solve():
    N, M = map(int, input().split())
    return len(str(ten_to_n(N, M)))

print(solve())

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

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

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

Solution (Python):
N, K = map(int, input().split())
for i in range(1, 100)[::-1]:
    if N // (K ** i) != 0:
        print(i + 1)
        break
else:
    print(1)

Solution (Python):
x,y = map(int,input().split())
z = 1
a = 0
while x >= z:
  z = z * y
  a = a + 1
  if x < z:
  	print(a)
  	break

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



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

 
 


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

Solution (Python):
import string
digs = string.digits + string.ascii_letters
def int2base(x, base):
    if x < 0:
        sign = -1
    elif x == 0:
        return digs[0]
    else:
        sign = 1
    x *= sign
    digits = []
    while x:
        digits.append(digs[int(x % base)])
        x = int(x / base)
    if sign < 0:
        digits.append('-')
    digits.reverse()
    return ''.join(digits)

n,m=map(int,input().split())
xx=int2base(n,m)

print(len(xx))

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

keta = 0
for i in range(10**10):
    ki = k**i
    if ki > n:
        print(keta)
        break
    else:
        keta += 1

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

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

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_N(X, n):
    if X//n:
        return base_N(X//n, n) + str(X%n)
    return str(X%n)

ans = len(base_N(N, K))
print(ans)

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

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

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

Solution (Python):

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


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):
import math
inp = input().split()
N = int(inp[0])
K = int(inp[1])
S = 0
while N > 0:
	N = math.floor(N / K)
	S += 1

print(S)

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

def to_baseK(decimal, K):
    result = ""
    while decimal:
        surplus = decimal % K
        result = str(surplus) + result
        decimal //= K
    return result

print(len(to_baseK(N, K)))

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,k = LI()
    if n == 0:
        return 1
    r = 0
    while n > 0:
        r += 1
        n //= k

    return r


print(main())

Solution (Python):
import numpy as np

i = list(map(int, input().split()))
N = i[0]
K = i[1]

N_ = np.base_repr(N, K)

print(len(str(N_)))

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

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

print(count)

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

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

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

a=n
seq=""
while a>=k:
    a=a//k
    b=a%k
    seq=seq+str(b)
seq=seq+str(a)
print(len(seq))

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

Solution (Python):
import sys

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

ii = 0
while True:
    if n < pow(k,ii):
        print(ii)
        sys.exit()

    ii = ii + 1

Solution (Python):
import math
number,base=input().split()
num=int(number)
bas=int(base)
converted=0
reminder=0
i=0

while num!=0:
    reminder=num%bas
    num=num//bas
    converted=converted+reminder*10**i
    i+=1



y=str(converted)
print(len(y))

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

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

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

a = n
c = 0
while True:
    a = a // k
    c += 1
    if a == 0:
        print(c)
        exit()

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

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

print(ans)

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

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

 
aws = Base_10_to_n(X,N)
a = len(aws)
print(a)

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

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

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

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

Solution (Python):
import math

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

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())
count = 0
for i in range(10**9):
    if N == 0:
        break
    N = N//K
    count += 1
print(count)

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

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

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

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

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

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

print(count)

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

Solution (Python):




def solve(inp):
    (N, K) = map(int, inp.readline().strip().split(' '))

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

    return str(i)


def main():
    import sys
    result = solve(sys.stdin)
    if result is not None and result != '':
        print(result)


if __name__ == '__main__':
    main()

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

while True:
  count = count + 1
  n, amari = divmod(n, k)
  if  n == 0:
    break

print(count)

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

ans = 0

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

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

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

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

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

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

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

ans = 1
for i in range(100):
  if N >= K**(i):
    ans = i+1
print(ans)

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

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

def Base(x,n):
    if (int(x/n)):
        return Base(int(x/n),n) + str(x % n)
    return str(x % n)
    
print(len(Base(N,K)))

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

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

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

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

maxDigits = 0

for i in range(1000):
  if N/K**i >= 1:
    maxDigits = i+1
  else:
    break;

print(maxDigits)

Solution (Python):
import math

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

Solution (Python):
import math
 
i = input().split()
N = int(i[0])
K = int(i[1])
result = 0
 
result = math.log(N, K)
result = 1 + int(result)

 
print(result)

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

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

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

flag = True
keta=0

while flag:
	keta += 1
	if k**keta > n:
		flag = False

print(keta)

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

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

Solution (Python):
import numpy as np
import math

n,k = [int(x) for x in input().split()]
ans = math.ceil(np.log(n)/np.log(k))
if n == 1:
  ans =1

print(ans)

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

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

Solution (Python):
import math
def main():
    N,K = map(int,input().split())
    count = 0
    while N != 0:
        N = math.floor(N / K)
        count = count + 1

    print(count)

if __name__ == "__main__":
    main()

Solution (Python):
a, b = map(int,input().split())
l =[]
while a/b >=1:
  l.insert(0,a%b)
  a /=b
  
if a >=1 and a<b:
  l.insert(0,a)
print(len(l))

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())
k = K
a = 1
while N + 1 > k:
    k = K * k
    a += 1
print(a)

Solution (Python):
tmp = list(input().split(" "))

N = int(tmp[0])
K = int(tmp[1])

count = 0

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

print(count)

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

a = list(map(int, input().split()))
print(len(base10to(a[0], a[1])))

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

count = 1

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

print(count-1)

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

Solution (Python):
import math
n, k = map(int, input().split())
print(1+math.floor(math.log(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)
print(len(Base_10_to_n(N,K)))

Solution (Python):
if __name__ == "__main__":
    n,k = (int(x) for x in input().split())
    ans = 0
    while n>0:
        n//=k
        ans += 1
    print(ans)

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

Solution (Python):
def base10to(n, r):
    ans = 0
    while n > 0:
        n //= r
        ans += 1
    return ans

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

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


N,R = map(int,input().split())
res = base10to(N, R)
print(len(res))

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

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

Solution (Python):
i = list(map(int, input().split()))
count = 0
while True:
    i[0] = int(i[0] / i[1])
    count += 1
    if i[0] == 0:
       break;

print(count)

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

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

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

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

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

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

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

for i in range(10000000001) :
    p = pow(K,i)
    
    if (N < p) :
        print(i)
        break

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

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

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

print(ans)

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

con = True
i = 0
while con:
    if N - K**i <0:
        print(i)
        break

    else:
        i += 1

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):
import math
n,k = map(int,input().split())
ans = 0

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

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

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

if __name__ == "__main__":
    resolve()

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

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

Solution (Python):
import math

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

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

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

Solution (Python):
n,k=map(int,input().split())
def trans(x,k):
    string=""
    while x!=0:
        u,v=divmod(x,k)
        string=str(v)+string
        x=u
    return string
print(len(trans(n,k)))

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

cnt = 1
while True:
    if N < K:
        break
    else:
        N = N/K
        cnt += 1

print(cnt)

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

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

Solution (Python):
def solve(string):
    n, k = map(int, string.split())
    c = 1
    while n >= k:
        c += 1
        n //= k
    return str(c)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

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

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

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

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

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

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

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


def hoge(n, k):
    if N == K:
        return len(str(n))
    for i in range(n + 1):
        tmp = k ** i
        if tmp > n:
            
            return i
            
            


print(hoge(N, K))

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

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

print(ans)

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

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

print(count)

Solution (Python):

"""
Created on Mon Mar  2 23:52:06 2020

@author: Kanaru Sato
"""

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

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

print(count)

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

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

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

count = 1

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

print(count)

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

Solution (Python):

import sys
from itertools import takewhile, count


def solve(N: int, K: int):
    return max(takewhile(lambda i: N >= (K ** i), count(0))) + 1


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

if __name__ == '__main__':
    main()

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

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

print(c)

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